objective c - What does @[indexPath] do -


i followed tutorial using uitableview. finished code

- (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath {     if(editingstyle == uitableviewcelleditingstyledelete)     {         message *message = [messagelist objectatindex:indexpath.row];         [self.persistencyservice deletemessagesfor:message.peer];         [messagelist removeobject:message];         [tableview deleterowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationleft];     } } 

my question is: @[indexpath] do? same as?:

[nsarray arraywithobject:indexpath] 

yes same, short notation defining array. can same nsdictionary , nsnumber well. here samples (and more here):

nsarray *shortnotationarray = @[@"string1", @"string2", @"string3"];  nsdictionary *shortnotationdict = @{@"key1":@"value1", @"key2":@"value2"};  nsnumber *shortnotationnumber = @69; 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -