I've got a little iOS project with SIP and it's quite convenient to have a 
graphic indicator that shows the connected state of the client to the server.  
Top right makes the most sense, and it's cleanest to use a UIBarButtonItem to 
hold the graphic and as the enumerated registration state changes, it's watched 
by KVO and just changes the graphic by changing the button, nice and straight 
forward.

Well, I got a request to put this in other places and I the code that I had to 
build the UIBarButtonItems created those items by creating a UIButton first and 
then used that view to init the UIBarButtonItem with 
initWithCustomView:myOtherButton.

This works like a charm.  I have a dictionary of UIBarButtonItems that are 
keyed of the stringified enum name and they are instantly swapped out as needed 
whenever the watched state changes.

So, I thought, "well, since I build these UIBarButtonItems from the UIButtons 
in the first place, I'll just keep an additional dictionary of buttons around 
that then just swap them in and out of an iBOutlet slot in the storyboard as 
needed.

Um.  Is this even possible?  Can you assign a UIButton instance that you have 
in code to an IBOutlet for a UIButton in the storyboard?   This does work 
perfectly for the nav bar's rightButton with barButtonItems, but is this even 
possible in code?   

I'm missing something here.  Or I'm not.  Any ideas?

Thanks,

Alex Zavatone
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to