erica / ios-6-cookbook Goto Github PK
View Code? Open in Web Editor NEWiOS 6 update
iOS 6 update
Core iOS6 Developer's Cookbook pg 392. Downloaded the latest code from github. When you select a cell the drawer appears. However, if you perform a swipe gesture on the action drawer as if you wanted to delete the drawer you see the delete button in the drawer cell. If you select the delete button the code crashes in libobjc.A.dylib with 'objc_exception_throw' on the com.apple.main-thread (serial).
How can the code be modified to prevent the appearance of the delete button in the action cell? I'd like to still allow the swipe gestures.
Thanks for this project! Should it be updated to iOS 7?
I've been using the RotatingSegue example in my app. I did a heap shot analysis with the steady state being before rotating forward and then snapshotting the heap after rotate forward and rotate back. I found that the RotatingSegue was not being dealloc'd (and thus responsible for holding onto my custom view controller and in turn a bunch of other objects).
In the end I noticed that
(a) the animation group delegate is a strong reference, the .h file states that it will last as long as the animation and
(b) the example code -[RotatingSegue animationWithDuration:] includes the line
group.removedOnCompletion = NO;
This statement overrides the default value. Commenting out the line allows the animation to be removed normally, the strong reference cycle broken, and the Segue to cleanup. Everything seems to still work fine.
This leaves one to wonder, what was the reason for overriding the default here? Is it unintentional?
Should the superclass loadView: method be called in the various loadView: methods defined in your main.m files?
In the Apple Documentation, it says:
"You can override this method in order to create your views manually. If you choose to do so, assign the root view of your view hierarchy to the view property. The views you create should be unique instances and should not be shared with any other view controller object. Your custom implementation of this method should not call super."
I can go through and take care of this, if you want!
The example app, Activity Controller, Chapter 8 / example 10, demonstrates a "roll your own activity", presenting a UIActivityViewController passing a UIActivity subclass instance, MyActivity, in the applicationActivities array. The MyActivity instance returns a TextViewController instance from its activityViewController method.
The presentation of the custom activityViewController and handling of the activityItems data works as described, however, though the -(void)done method handler is called by the TextViewController Done button event, in the iPad simulator and on an iPad device, the custom activityViewController (TextViewController) is not dismissed.
Per Apple UIActivity Class Reference documenting activityViewController:
"Discussion
The default implementation of this method returns nil. Subclasses that provide additional UI using a view controller can override this method to return that view controller. If this method returns a valid object, the system presents the returned view controller for you, instead of calling the performActivity method. On iPad, your view controller is presented inside of a popover. On iPhone and iPod touch, your view controller is presented modally.
Your custom view controller should provide a view with your custom UI and should handle any user interactions inside those views. Upon completing the activity, do not dismiss the view controller yourself. Instead, call the activityDidFinish: method and let the system dismiss it for you.
Note: If the view controller returned by this method presents additional view controllers, you are responsible for presenting and dismissing those view controllers. However, you must not dismiss the view controller returned by this method."
Is this an Apple bug? Or is there something I'm not doing correctly?
Thanks for the awesome book and recipes!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.