Tag: cocoa touch
please set CG_CONTEXT_SHOW_BACKTRACE environmental variable
Despite looking over more than 3 post (made in 2015) about this problem, non have solved mine. When ever I run, a simple, code to draw a line using UIBezierPath the program would return me this: : CGContextSetStrokeColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. : CGContextSetFillColorWithColor: […]
UISearchBar does not display Cancel button when added as subview to UINavigationBar
I’m following the answer at https://stackoverflow.com/a/14235624/855680 to animate my UISearchBar which starts off with a smaller width, then expands to the full width of the iPhone screen when active. It expands as expected, except that the Cancel button does not appear at all. I’ve tried calling setShowsCancelButton:animated in both searchBarTextDidBeginEditing: and searchDisplayControllerWillBeginSearch:, but to no […]
Copy a file from iPhone sandbox to Desktop?
I am developing an iPhone app for uni and we create an sqlite database file within the iPhone’s sandbox directory. Our application writes internally to this file, I am wondering how it would be possible to get this file back to my desktop. I don’t really mind how it can be done, any way is […]
How do you get mutable dictionaries from AFNetworking and AFJSONRequestOperation?
I’m using JSONKit with AFNetworking’s AFHTTPClient (with AFJSONRequestOperation) and I can’t seem to figure out how one might trigger the use of the mutableObjectFrom… methods of JSONKit rather than the normal parser methods which return (or arrays of) JKDictionary. Is this possible without modifying AFNetworking?
NSMutableArray arrayWithArray: vs. initWithArray:
These both work in my app without any noticeable difference: 1) theArray = [[NSMutableArray alloc] initWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:theData]]; 2) theArray = [NSMutableArray arrayWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:theData]]; [theArray retain]; However, are they really equivalent? (1) has an alloc statement, whereas (2) does not. Is one preferable over the other?
Unbalanced calls to begin/end appearance transitions for <TSActivityMapVC: 0x81b1000>
When I init UITabBarController where each tab include UINavigationController and each UINavigationController include UIViewController when in UIViewController I do something like TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@”TSActivityDetailsVC” bundle:nil]; [self.navigationController pushViewController:c animated:YES]; I have animation, but when I press back button – I not have animation and get error Log: push view controller Unbalanced calls […]
My goal is to have a UITableViewCell slide off one side of the screen (like in Twitter) and then slide back on from the other side. I’m able to make the cell slide off the screen to the right, but I can’t seem to figure out how to get it to slide back onto the […]
Where to declare a static variable in objective-c?
I did some research about static variables in objective-c and I found people declare static variables in different places which made me really confused. For the following code, can I put static NSUInteger counter;outside of the implementation? (Right after my #import “xxx.h”) Can I put static NSUInteger counter;inside of +initialize class method? Can I put […]
Model classes — what the heck do they really mean?
I really can’t seem to get the hang of Model objects in MVC. I wonder why we can’t just work with arrays and dictionaries and arrays OF dictionaries? I understand that they represent the ‘data’ that my other classes manipulate and work with. But what is the proper way they should be constructed? Suppose I’ve […]