cocoa-touch

NSURLConnection sendAsynchronousRequest - communicating with HTTPS

折月煮酒 提交于 2019-12-24 20:33:08
问题 Am working on an iPhone App which fetches an image from a URL. I was using 'NSData dataWithContentsOfUrl] & it worked fine. But then, as you might have guessed, the request is synchronous. I want the request to be asynchronous. So, I tried using the NSURLConnection's sendAsynchronousRequest() call. But this returns the following error in the method 'didFailWithError' : Error Domain=kCFErrorDomainCFNetwork Code=310 "There was a problem communicating with the secure web proxy server (HTTPS).

Modal View Controllers - UIBarButtonItems Do Not Persist

一世执手 提交于 2019-12-24 20:32:39
问题 I present modal view controllers, packaged in a UINavigationController. When they first appear, the bar button items are alright. However, if I click a button and a new view controller is pushed to the UINavigationController, and then I use the back button of that view controller, and it gets popped back to the original modal view controller , the buttons do not show up , (but they work when I click them -> just can't see them) I can't seem to figure out why this occurs. Here's some code. Oh,

How to make a UITextView scroll horizontally as the user types?

社会主义新天地 提交于 2019-12-24 20:25:34
问题 This seems like it should be simple but I can't work out how to do it. I've created a UITextView in interface builder. It doesn't sit in a table cell or anything fancy like that. What I'd like to do is have the UITextView scroll itself to the left when the user has typed their way all the way to the right margin. At the moment it just does a word wrap, I understand the word wrap makes sense in most situations but I need it to scroll instead. What I'm after is the same behavior it exhibits

Displaying next view after splashscreen

你说的曾经没有我的故事 提交于 2019-12-24 20:19:25
问题 I want to load a view of my choice after the default splash view of iphone launches. Does someone know how to achieve this ? i am new to xcode and ios development. 回答1: There is a project at Github called LaunchImageTransition, it should provide a custom view after the Default.png image has been loaded. 回答2: Please, check this project https://github.com/QuickBlox/ChattAR-ios Here uses custom splash screen after default splash disappeared. 回答3: Add [self setUpSplash]; method in - (BOOL

Reading Specific Part Of A Text File

烂漫一生 提交于 2019-12-24 19:33:58
问题 I've found a few similar questions to this but not relating to XCode. I am creating an app where clicking a button generates a randomised quote and displays it in a label. What I'd like to do is have a text file with all of the quotes, then have my app randomly select a quote from that file. The problem is that my code at present reads the entire contents of the file. textHIYP = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; textHIYP.editable = NO; [self.view addSubview

Finding image name loaded into UIImage instance

爱⌒轻易说出口 提交于 2019-12-24 19:27:04
问题 How can I find out what the image name (usually file name?) loaded into a UIImage instance is? In this case, they were all initWithContentsOfFile: . 回答1: Once it's loaded using that, you can't. The file name is only used to load the data into memory. After that, it becomes irrelevant. If you need to maintain the file name, then perhaps you need to make a class with the filename (as an NSString or NSURL , perhaps) and the image data (as an NSImage or NSData object) as ivars. I'm not sure what

warning: passing argument 3 of 'objc_setProperty' as signed due to prototype

我的未来我决定 提交于 2019-12-24 19:24:04
问题 The compiler complains about this, after I activated all kind of warnings: I have an app delegate like this: #import <UIKit/UIKit.h> @class MyViewController; @interface TestAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MyViewController *myViewController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet MyViewController *myViewController; @end In the implementation file, I have the synthesize code: @synthesize window;

Handling of awakeFromNib for the object that is File's Owner

核能气质少年 提交于 2019-12-24 19:17:46
问题 I know there are many related questions why awakeFromNib is not called when instantiating some view. The message that the certain view is awaken from Nib is sent to the view itself and this message is not delivered to the File's Owner. I saw Why won't my awakeFromNib fire?. So, what will happen if you create an view's instance whose File's Owner is itself in the xib file? In other word, you have your own custom view named MyCustomView.swift and MyCustomView.xib. And in the xib file, you set

iPhone Application UI Implementation Suggestion

心不动则不痛 提交于 2019-12-24 19:11:02
问题 I am building an iPhone app, which will function similarly to many restaurant finder applications. When launched, the application will start with a view that allows a user to specify a zip code for performing a search. Alternatively, if the user has an iPhone with a GPS, the application will automatically perform a search based on their current location, although it will be possible for the user to specify their own location. After the search has been performed, the user will be presented

UISlider in UIBarButtonItem impacts animation behavior

為{幸葍}努か 提交于 2019-12-24 19:03:09
问题 In IB, I set a view MyView with an UIToolBar and I drop an UISlider on it. IB automatically embeds it in an UIBarButtonItem and sets its view with the UISlider. I display this MyView in a navigation controller with animation. UIViewController *myVC = [[UIViewController alloc] initWithNibName:@"MyView" bundle:nil]; [self.navigationController pushViewController:myVC animated:YES]; [myVC release]; MyView is displayed but without animation. Apart from that, everything works fine, I can use the