Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:04:46+00:00 2026-06-08T09:04:46+00:00

So I am creating a NSDictionary that is feeding a method data to be

  • 0

So I am creating a NSDictionary that is feeding a method data to be used, but some of the key values in the keys array will not always be filled with values.. Say I have 18 keys (which I do).. I might only use 5 during one call but 6 in the other or even all 18 at some points in my code.

What I would like to know is how can I add NULL values into those keys so later on when i look through the keyvalue pairs I can see which keys i need to worry about and which I can forget? so the question is, if i want to add nothing/null to a key how do I do that without causing errors or thinking its the end of the array nil..

This is what I have currently but its giving me a bad exe error as soon as I try to read the NSDicionary

NSDictionary *sendSeriesDictionary = [[NSDictionary alloc] init];

NSArray *keys = [NSArray arrayWithObjects:@"Code", @"MaID", @"MoID", @"SuID",@"SMID",@"Ye",@"KID",@"KBlID",@"KBk",@"CaID",@"Caer",@"Loe",@"Kepe",@"KTGroup",@"Cesc",@"LID",@"IN",@"LaID", nil];


NSArray *objects = [NSArray arrayWithObjects: NULL, manufactureIdString, modelIdString, subModelIdString, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, nil];

sendSeriesDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];

just to let you know the key names will be changed this is just for testing/example out how to do this.

any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:04:47+00:00Added an answer on June 8, 2026 at 9:04 am

    The NSNull class is designed for this. You just have to make sure that whatever is going to be using the collection checks for NSNull values.

    NSArray *objects = [NSArray arrayWithObjects: [NSNull null], manufactureIdString, modelIdString, subModelIdString, [NSNull null], ..., nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an app that displays a random word (a key from an NSDictionary)
I am creating a XML with xmlWriter, I have values in an NSDictionary that
I am creating application that simply reads data from an XML file and displays
I created a plist that contains an NSDictionary structure. The key is a label
I am creating an NSDictionary with -initWithObjectsAndKeys:. For every object I provide to that
I'm creating an XML document from an array of NSDictionarys as follows: for (NSDictionary
I have a UITableView for an app I am creating that will show Movie
i am creating an application that needs to work with categories. there will be
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Creating a server-side socket will fail if I'm trying to use the same port

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.