Reputation: 756
Due to a bug/problem with ZBar and iOS 7 we can not create, destroy and recreate a view controller that's used for scanning. So we need to keep an permanent and global instance of it to be accessed by several different views.
In the current solution the scanner view instance is a member of the app delegate and instanciated when the application starts. When it needs to be displayed it is accessed by [[UIApplication sharedApplication] delegate]
.
This is a forced solution but I still want it to be as descent as possible. Is there a better place to put the scanner view controller?
Upvotes: 1
Views: 86
Reputation: 4091
Better you put in .pch file,
#define MY_APP_DELEGATE ((AppDelegate *)[UIApplication sharedApplication].delegate)
Upvotes: 2