Questions tagged [nsnull]

The NSNull class defines a singleton object used to represent null values in collection objects (which don’t allow nil values).

82 questions
0
votes
1 answer

ios: NSNull lldb error when using substringToIndex

I have the following code: NSString *subtitleFull = [dictionary valueForKey:@"distance"]; NSString *subtitle = [subtitleFull substringToIndex:2]; When I run the code I get the following error: …
wwjdm
  • 2,568
  • 7
  • 32
  • 61
0
votes
1 answer

Objective C setter in superclass called instead of subclass

I am trying to subclass UILabel so the setter setText check for null to avoid this if the supplied parameter is a NSNULL: [NSNull isEqualToString:]: unrecognized selector sent to instance The code is as below. I stepped through in a debugger and…
NaN
  • 598
  • 3
  • 15
0
votes
1 answer

How should I tidy up this code:

if ([dictInfoForThisBusiness[@"LikeNumber"] isNotEmpty]) { BusinessToSave.numberOfLike =dictInfoForThisBusiness[@"LikeNumber"]; } else { BusinessToSave.numberOfLike = @(0); } if (dictInfoForThisBusiness[@"DislikeNumber"]) { …
user4234
  • 1,523
  • 1
  • 20
  • 37
0
votes
2 answers

How to remove 's from NSDictionary?

I'm trying to use the writeToFile method of an NSArray of NSDictionaries which doesn't allow nulls. I figured just loop through and find them and replace with empty NSString's but I can't get it to work. This is what I'm trying. EDIT: The NSArrays…
TijuanaKez
  • 1,472
  • 3
  • 20
  • 28
-1
votes
3 answers

NSNull length crash with textField,

when i enter any character or number with keyboard.the app crash with this info "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x103b5daf0'". And every…
-1
votes
1 answer

Replacing NSNulls inside NSDictionary

this question is similar to Replace occurrences of NSNull in nested NSDictionary In swift I am getting an error (I believe because of NSNull's) I don't really care if the NSNull becomes an empty string or a nil. I am just wanting to get the code to…
Brandon Sturgeon
  • 223
  • 4
  • 13
-4
votes
2 answers

NSMutableArray Crash When checking for count

I'm using NSMutableArray with object name myArray : When there is no data from server My mutable array print In next line of code if check for count it crashes. How to resolve this please help me. NSLog(@"Print Array : %@", myArray); …
1 2 3 4 5
6