Reputation: 11851
I have this array:
NSArray *currentPath;
and it gets populated here:
currentPath = [[[self.tableData objectAtIndex:indexPath.row] objectForKey:@"Name"] componentsSeparatedByString:@"FTP\\"];
I need to repopulate this array again
NSString *newPreviousPath = [previousPath stringByReplacingOccurrencesOfString:nextItemToRemoveString withString:@""];
currentPath = [newPreviousPath];
but I keep getting this error:
Expected identifier
How do I fix this and accomplish this ?
Upvotes: 3
Views: 59
Reputation: 98
currentPath = [newPreviousPath]; As in here you are using Literals syntax,it is not the right way to assign a array. You need to do following currentPath = @[newPreviousPath];
Upvotes: 0
Reputation: 37729
Unlike swift, in objective c you should do it like:
currentPath = @[newPreviousPath];
See what magic @
symbol does in Objective C, detailed answer here: Is there some literal dictionary or array syntax in Objective-C?
Upvotes: 5