cocoa-touch

didSelectRowAtIndexPath not being called?

雨燕双飞 提交于 2019-12-25 03:04:57
问题 For some odd reason my didSelectRowAtIndexPath is not being called in my code. Anyone have a clue why? Everything else works, it may be something to do with my sections. I don't understand why my deletion class works but didSelectRowAtIndexPath doesn't. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return self.subjectArray.count; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [self.subjectArray objectAtIndex:section

View not updating when autolayout constraint modified programmatically

梦想的初衷 提交于 2019-12-25 02:54:07
问题 I'm having trouble getting my view to lay itself out properly after modifying a second constraint (the first works fine). I'm modifying one constraint, animating it, and then modifying another constraint in the completion block (without animation). My reason for doing this is I don't want the second constraint change to affect the animation, but I want it to instantly take effect as soon as the initial animation completes. The problem is the second constraint change is simply not taking

presentModalViewController not working properly

时间秒杀一切 提交于 2019-12-25 02:47:57
问题 I have 3 views. I want to do the following: A presents B modally A dismisses B A presents C modally I have setup a delegate pattern where A is B's delegate. This is how I am presenting and dismissing in B: [delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO] [delegate presentC]; //this is just [self presentModalViewController:c animated:NO]; For some reason my app crashes when I execute this code with no debugger results (I have NSZombieEnabled). When I comment out

Flip the Image when saving out to disk

与世无争的帅哥 提交于 2019-12-25 02:47:20
问题 I am currently using the following code to write a CGContext to a PNG on disk: CGImageRef image = CGBitmapContextCreateImage(context); UIImage *myImage = [UIImage imageWithCGImage:image]; NSData *data = UIImagePNGRepresentation(myImage); [data writeToFile:path atomically:YES]; I found that the orientation of the resultant file is flipped from the way it appears on the screen(on an iPhone). What is the best way to flip this image on save so that when I later load the image it will be up right?

IPhone JSON to TableView

本小妞迷上赌 提交于 2019-12-25 02:42:48
问题 Im having issues with my code, its returning an error that says... 2011-12-24 22:52:36.280 BusinessManager[479:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x3e965e0'> Here is the code: #import "BusinessManagerAppDelegate.h" #import "ProspectViewController.h" #import "JSON.h" @implementation ProspectViewController @synthesize jsonArray; - (void)viewDidLoad { NSURL *jsonURL =

why reloadData shouldn't be called on methods that delete/insert rows

泄露秘密 提交于 2019-12-25 02:37:34
问题 I was trying to implement sparrow like row swiping that shows an action row (My starting point was this code). for each row I create.. I also create a 'backView' UITableViewCell that references the parent row.. so that when I click delete on the backView for example.. it knows which email to delete etc. Instead of using iOS's built in editing mode delete.. I just created a button on the backView and attached an event handler to it. the parent cell is the delegate of the back view.. and the

UINavigationController subclass won't set titleView on load

本秂侑毒 提交于 2019-12-25 02:28:43
问题 I've just created a simple subclass of UINavigationController . #import "TTNavigationController.h" @implementation TTNavigationController - (void)viewDidLoad { [super viewDidLoad]; UIImage *logo = [UIImage imageNamed:@"logo"]; UIImageView *logoView = [[UIImageView alloc] initWithImage:logo]; self.navigationItem.titleView = logoView; } But when I run the project the navigation bar has not the titleView with the logo. Otherwise if I try to move those 3 lines of code in viewDidLoad of my view

How do I stream video from the iPhone

白昼怎懂夜的黑 提交于 2019-12-25 02:28:35
问题 Is it possible to stream video directly from the iPhone? Is there any undocumented way to do it? Or am I missing something? 回答1: With iOS4 you can gain access to the raw video frames via AVCaptureVideoDataOutput. Once you have the frames, its up to you to compress them, package them up, and send them wherever they need to go. 来源: https://stackoverflow.com/questions/3206478/how-do-i-stream-video-from-the-iphone

What's the Best Way to Send Parameters to a UIViewController?

拜拜、爱过 提交于 2019-12-25 02:21:49
问题 I ask this question because it appears that viewDidLoad gets called before the main block of the initializer does and the class variables I'm initializing in the initializer are turning up nil in viewDidLoad. For your reference, I'm doing this entire viewcontroller programmatically and I've created a custom initializer so I can take in various parameters to be used in my viewcontroller. My custom initializer calls UIViewControllers designated initializer of course. Basically, I'm curious

Initialize custom UITableViewCell

冷暖自知 提交于 2019-12-25 02:21:01
问题 I'm trying to load a single custom cell into a UITableView and it keeps throwing an error UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath: I have no idea why. I have linked my table view cell to the UITableViewCell definition in my code, but it keeps giving me this error. Here is my code; any help would be greatly appreciated. #import "RegisterDeviceViewController.h" @implementation RegisterDeviceViewController @synthesize checkString; @synthesize