[Solved] My application crashes with this error – ‘NSInvalidArgumentException’

ShopCollectionObject.h #import <Foundation/Foundation.h> @interface ShopCollectionObject : NSObject @property (nonatomic) int message_id; @property (strong, nonatomic) NSString *Name; @property (nonatomic) int TimeAsPrice; @property (strong, nonatomic) NSString *Avathar;//user,Name_User,LocationOfUser,message_id @property (strong, nonatomic) NSString *user; @property (strong, nonatomic) NSString *Name_User; @property (strong, nonatomic) NSString *LocationOfUser; -(instancetype) initWithID: (int)msgID Name:(NSString *)Profile_name TimeAsPrice:(int) GivenTimeAsPrice Avathar:(NSString *) PhotoOfAvathar user:(NSString *)UserAvathar Name_User: (NSString *) … Read more

[Solved] UITextView if line numbers is 2 [duplicate]

For Count the number of lines of text int numLines = textView.contentSize.height / textView.font.lineHeight; NSLog(@”number of line – %d”, numLines); And for iOS 7 see this Question/Answer. EDIT for iOS < 7: This is proper answer UIFont *myFont = [UIFont boldSystemFontOfSize:13.0]; // your font with size CGSize size = [textView.text sizeWithFont:myFont constrainedToSize:textView.frame.size lineBreakMode:UILineBreakModeWordWrap]; // default … Read more

[Solved] How do I get the shortest path between two given coordinates in MapView? [closed]

You can use Directions API given by Google Maps SDK. Example: https://maps.googleapis.com/maps/api/directions/json?origin=lat,long&destination=lat1,lon1 It takes source and destination latitude and longitude and returns a JSON object of routes and the distance for each route. You can select the shortest route and map it. 0 solved How do I get the shortest path between two given coordinates … Read more

[Solved] When making an if statement can I make it so a void that is already running be overwritten? [closed]

This line sounds strange: if (RedCircle2.hidden = YES, BlueCircle.hidden = YES, YellowCircle.hidden = YES) You are assigning YES to hidden property of RedCircle2, BlueCircle and YellowCircle and this will always be TRUE as a boolean expression…. You probably wants to do this: if (RedCircle2.hidden && BlueCircle.hidden && YellowCircle.hidden) 3 solved When making an if statement … Read more

[Solved] Accessing values from NSArray [duplicate]

As others have said, the variable myarray contains a dictionary. To explain fully: In Objective-C, a variable that contains an object actually contains a pointer to that object. Think of it as an entry in your program’s rolodex. The variable has a type, “pointer to array”. It points to an object that should be an … Read more

[Solved] To convert a particular format to NSDate [closed]

Use this code to get the Current Date NSDateFormatter *dateFor=[[NSDateFormatter alloc]init]; NSString *currentDateString = @”2014-01-08T21:21:22.737+05:30″; [dateFor setDateFormat:@”yyyy-MM-dd’T’HH:mm:ss.SSSZZZZ”]; NSDate *currentDate = [dateFor dateFromString:currentDateString]; NSLog(@”CurrentDate:%@”, currentDate); 5 solved To convert a particular format to NSDate [closed]