Øyvind Hauge

NSChat

Rules → spiff.io/nschat.rules —  Discussion for iOS and OS X ...
Oct 31, 2015 16:17
Need to read up on basic block syntax, I guess.. once again, thanks
Oct 31, 2015 16:16
when I added closing ;
Oct 31, 2015 16:15
perfect! worked like a charm..
Oct 31, 2015 16:14
thanks a lot! will try at once
Oct 31, 2015 16:14
to the initializer
Oct 31, 2015 16:14
I want to pass in my custom implementation of the actionHandler
Oct 31, 2015 16:13
- (instancetype)initWithTitle:(NSString *)title
buttonTitles:(NSArray *)buttonTitles
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
actionHandler:(void(^)(LGActionSheet *actionSheet, NSString *title, NSUInteger index))actionHandler
cancelHandler:(void(^)(LGActionSheet *actionSheet, BOOL onButton))cancelHandler
destructiveHandler:(void(^)(LGActionSheet *actionSheet))destructiveHandler;
Oct 31, 2015 16:13
..And then used in initialization of the LGActionSheet:
Oct 31, 2015 16:12
It is defined as a property: @property (strong, nonatomic) void (^actionHandler)(LGActionSheet *actionSheet, NSString *title, NSUInteger index);
Oct 31, 2015 16:11
Sure thing! thanks
Oct 31, 2015 16:09
Doesn't compile "Incompatible block pointer types initializing [...]".
Oct 31, 2015 16:06
Yup, struggling with the syntax.. void (^actionHandler)(LGActionSheet actionSheet, NSString *title, NSUInteger index) = / What should I write here? /^{ / Want to do something cool here */ };
Oct 31, 2015 16:03
pretty new to blocks
Oct 31, 2015 16:02
I'm trying to implement it with [the block] = ^{};
Oct 31, 2015 16:00
Hi! I can't figure out how to initialize this block: void (^actionHandler)(LGActionSheet *actionSheet, NSString *title, NSUInteger index) Any help?