[Solved] Upload photos with NSURLSession in background

From the comments above, it seems like you’ll be uploading several photos at a time and for that a “fromData” approach does not seem like a good idea. Firstly, high resolution photos have several megabytes in size. If your loading a 5mb photo into memory, using NSData, you’re probably fine. But loading 10 photos would … Read more

[Solved] What are getter and setter methods? [duplicate]

With setters you set the value of a property in a instance of a class. A getter is a function that gives you the variable as a return when you call it. You use setters and getters to control the access to private properties. 2 solved What are getter and setter methods? [duplicate]

[Solved] How to retrieve data from a website into an iphone app

If your problem is getting data from website to iphone then you can just use JSON Parsing to get data. Just you have to pass all the data as JSON string in iPhone from your website. And then parse the data once received into your iPhone. Here you can refer to this link http://www.raywenderlich.com/5492/working-with-json-in-ios-5 Hope … Read more

[Solved] Objective-C passing parameters in void method

Here is an example with an integer parameter. -(void)viewDidLoad { [self callMethodWithCount:10]; } -(void)callMethodWithCount:(NSInteger)count { //stuff here } In objective-c the parameters are included within the method name. You can add multiple parameters like this: -(void)viewDidLoad { [self callMethodWithCount:10 animated:YES]; } -(void)callMethodWithCount:(NSInteger)count animated:(BOOL)animate{ //stuff here } It seems you may be misunderstanding what the void … Read more

[Solved] Regarding retain count [closed]

Retain counts are pretty much useless, see http://whentouseretaincounts.com for details of why. However, I added calls to retainCount to your code and ran the following: NSArray *arr = [[NSArray arrayWithObjects:@”ag”, @”sdfg”, @”dgh”, nil] retain]; NSLog(@”%ld”, [arr retainCount]); NSArray *newArr = [[arr mutableCopy] retain]; NSLog(@”%ld”, [newArr retainCount]); [arr release]; NSLog(@”%ld”, [arr retainCount]); [newArr release]; NSLog(@”%ld”, [newArr … Read more

[Solved] Objective C NSArray [closed]

Your array is an array literal which means it is immutable. In order to make an array that you can change, do this: NSArray *oneInfo = @[@{@”trackTime”:theTrack[@”seconds”],@”trackPrice”:theTrack[@”price”],@”trackWait”:theTrack[@”wait”]}]; NSMutableArray* somethingICanChange = [oneInfo mutableCopy]; [somethingICanChange addObject: moreData]; Note that, if you are not using ARC (why not?), somethingICanChange is an array that you own and needs to … Read more

[Solved] What is the equivalent code for this Swift code?

I think it is the following code, I haven’t tested it, since I don’t know the result. CGAffineTransform *scale = CGAffineTransformMakeScale((1 – 0.5 * scaleFactor), (1 – 0.5 * scaleFactor)); CGAffineTransform *scale2 = CGAffineTransformMakeTranslation(-(self.player.bounds.width / 4 * scaleFactor), -(self.player.bounds.height / 4 * scaleFactor)); // concat the 2 CGAffineTransforms. CGAffineTransform *transform = CGAffineTransformConcat(scale, scale2); self.player.transform = … Read more

[Solved] Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4] ‘

Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4] ‘ solved Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4] ‘

[Solved] How to use UIPickerView to show date months and Year(Upto 2015)?

It is as simple as that just copy paste this code in your viewdidload. Here in this code the setMaximumDate set the what you want for. That will be your Max Date. Here in this piece of code I used max date as TODAYS DATE. UIDatePicker *datePicker = [[UIDatePicker alloc]init]; datePicker.datePickerMode = UIDatePickerModeDate; [datePicker setMaximumDate:[NSDate … Read more

[Solved] Can’t set cell title’s text

Since you declared title and text as properties, but for some reason get the exception: [Notez setTitle:]: unrecognized selector sent to instance, apparently I can only make another guess here. Usually, when declaring a property, you get a setter and a getter method for it. This way you can omit writing these by hand if … Read more