[Solved] How to refer to an array? [closed]

You shouldn’t need an array of points, at least not in this case. A center can only be one point: self.center = CGPointMake(10,10); The first integer is the x coordinate and the second is the y. Update: If I understand your question in the comments, you can do this: for (int i = 0; i … Read more

[Solved] Understanding a method from objective-c [closed]

In this method a is the parameter of class StockHolding. So when passing parameter to the method, always * symbol followed by class. So that it will typecast to the object accordingly. For example below:- This is the NSString class method:- + (id)stringWithString:(NSString *)aString In this aString is the parameter whose type refers to NSString … Read more

[Solved] All NSUserDefaults, all in tableview

You can set an array to userDefaults, the implementation is very simple. – (void)viewDidLoad { [super viewDidLoad]; [self addTextToUserDefaults:@”hello”]; [self addTextToUserDefaults:@”how are you?”]; [self addTextToUserDefaults:@”hi”]; for (NSString *text in [self textsInUserDefaults]) { NSLog(@”%@”, text); } } – (void)addTextToUserDefaults:(NSString *)aText { NSMutableArray *texts = [[[NSUserDefaults standardUserDefaults] objectForKey:@”textArray”] mutableCopy]; if (!texts) { texts = [NSMutableArray new]; } … Read more

[Solved] UIWebview loads with blank page [closed]

I resolved this issue, error in this below line destViewController.path = [documentsDirectory stringByAppendingPathComponent:[dirFiles objectAtIndex:indexPath.row]]; replaced it with below line destViewController.path = [inboxPath stringByAppendingPathComponent:[dirFiles objectAtIndex:indexPath.row]]; solved UIWebview loads with blank page [closed]

[Solved] What are some different ways of making an effective email validation method without using regular expression in objective c?

my attempt @interface Tester : NSObject +(BOOL) testForValidMail:(NSString *)mail; @end @implementation Tester +(BOOL)testForValidMail:(NSString *)string { NSRange atRange = [string rangeOfString:@”@”]; BOOL b = NO; if ((atRange.location != NSNotFound) //is `@` present && (atRange.location != 0) // and is `@` not at the beginning -> left substring exist && (atRange.location != string.length-1) // and not at … Read more

[Solved] Get the trim value from the double value

So basically you want to round a number up. ceilf is what you want, it will return a float so you want to use that to one decimal place. NSLog(@”ceilf %.1f”, ceilf(1.23456)); 2015-03-06 14:42:39.537 [xxxx] ceilf 2.0 1 solved Get the trim value from the double value

[Solved] objective-c index in an Array [closed]

Remove these lines: [acat addObject:@”cat1″]; [acat addObject:@”cat2″]; [acat addObject:@”cat3″]; [acat addObject:@”cat4″]; Declare your array and NSURL not in viewDidLoad, Do this instead in your .h: @interface AZViewController : UIViewController { NSInteger _acatindex; NSMutableArray *acat; NSURL *url; } @property (weak, nonatomic) NSMutableArray *acat; – (IBAction)catbutt:(id)sender; Now cut the following code from viewDidLoad(): url = [[NSBundle mainBundle] … Read more