Search Results

Search found 15682 results on 628 pages for 'iphone'.

Page 142/628 | < Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >

  • How to ask UIImageView if MultipleTouchEnabled is "YES"

    - by Rob
    I have created a few UIImageViews programmatically, but I have a feeling that even though I setMultipleTouchEnabled to YES during the setup, it is not getting set properly and it's leading to multi-touch issues. My question is, within touchesBegan how do I go about asking the UIImageView that was touched if it has MultipleTouchEnabled or not? I am fairly new to this so I'm really stumbling through code and learning as I go (with your help of course). Thank you ahead of time!

    Read the article

  • Localization of Settings.bundle defaultvalues

    - by notnoop
    How can I have a localized default values in the Settings bundle? I encounter this problem for regionally sensitive defaults. Consider an option in the settings bundle to indicate whether to show distances in miles or kilometers. The default settings for en_US and en_GB is 'miles, and km for everywhere else. Does the SDK provide a settings for that? Or should I just add a third option: 'Infer metric system, miles, kms'

    Read the article

  • Autorotation and multiple view controllers

    - by alku83
    I'm creating an iPad application which should only work in portrait and portait upsidedown modes. For performance reasons in my applicationDidFinishLaunching method I'm creating several viewControllers, and adding them to my main window as subviews. I then hide the ones I don't want to see straight away. There is no tab bar or navigation controller. My problem is that only the first viewController seems to be receiving the rotate calls. I have verified this by swapping around the order in which I add the subviews to the main window and NSLog's. Is there some way I can force all the controllers to receive the calls? Some of my views are designed to lay over the top of another view, but this behind view will not always be the same one - so it seems to make sense to have the overlay view in a separate view controller. Am I doing something fundamentally wrong, and that's why it's not behaving as I would expect? EDIT: The accepted answer for this question seems to indicate the exact problem I'm facing: http://stackoverflow.com/questions/548142/uiviewcontroller-rotate-methods

    Read the article

  • Detecting bad jpeg images

    - by Gerard Cerchio
    The question on validating jpegs on network transfer is very helpful. Could we take this question one step further? What if the image data is incomplete or corrupt from the server? The complete transport works, the MIME type is image/jpeg, the UIImage is constructed and non-nil but the renderer discovers inconsistencies in the data and the log shows "Bad Huffman code" or "premature end of data segment" How would I capture this error before tossing the UIImage into the view context and thereby getting a not-pretty image on the screen? Could I render it to a non-screen context and capture the error?

    Read the article

  • NSFetchedResultsControllerDelegate in a second view controller (not firing?)

    - by MTBPatriot
    I am running into an issue similar to the one described here: http://stackoverflow.com/questions/1319940/nsfetchedresultscontrollerdelegate-not-firing (the delegate for my NSFetchedResultsControllerDelegate are not being called on my second view controller) I can't seem to get the proposed solutions to work. I have a main view that loads information from Core Data just fine, but when it pushes a separate controller (and passes the managed object to it), the delegate methods won't fire. I've read about 'mergeChangesFromContextDidSaveNotification' but I don't understand how to synchronize the two manage objects and/or get the delegate methods to be called. Any help would be greatly appreciated. Thank you, Mike

    Read the article

  • Executing codes in viewDidLoad

    - by iSharreth
    In my .m file : (void)viewDidLoad { [super viewDidLoad]; /* Some codes for picker view and slider */ } I used a button to navigate to second view by using the below code: (IBAction)goToPlay{ [self presentModalViewController: secondViewController animated: YES]; } I used another button to go back to first view by using below code: (IBAction)goBack{ [self dismissModalViewControllerAnimated:YES]; } Now the viewDidLoad method is not calling. I had written some codes in viewDidLoad in first view and I want to execute it when pressing goBack button in second view. What should I do? Anyone please help.

    Read the article

  • Asynchronous vs Synchronous vs Threading in an iPhone App

    - by Coocoo4Cocoa
    I'm in the design stage for an app which will utilize a REST web service and sort of have a dilemma in as far as using asynchronous vs synchronous vs threading. Here's the scenario. Say you have three options to drill down into, each one having its own REST-based resource. I can either lazily load each one with a synchronous request, but that'll block the UI and prevent the user from hitting a back navigation button while data is retrieved. This case applies almost anywhere except for when your application requires a login screen. I can't see any reason to use synchronous HTTP requests vs asynchronous because of that reason alone. The only time it makes sense is to have a worker thread make your synchronous request, and notify the main thread when the request is done. This will prevent the block. The question then is bench marking your code and seeing which has more overhead, a threaded synchronous request or an asynchronous request. The problem with asynchronous requests is you need to either setup a smart notification or delegate system as you can have multiple requests for multiple resources happening at any given time. The other problem with them is if I have a class, say a singleton which is handling all of my data, I can't use asynchronous requests in a getter method. Meaning the following won't go: - (NSArray *)users { if(users == nil) users = do_async_request // NO GOOD return users; } whereas the following: - (NSArray *)users { if(users == nil) users == do_sync_request // OK. return users; } You also might have priority. What I mean by priority is if you look at Apple's Mail application on the iPhone, you'll notice they first suck down your entire POP/IMAP tree before making a second request to retrieve the first 2 lines (the default) of your message. I suppose my question to you experts is this. When are you using asynchronous, synchronous, threads -- and when are you using either async/sync in a thread? What kind of delegation system do you have setup to know what to do when a async request completes? Are you prioritizing your async requests? There's a gamut of solutions to this all too common problem. It's simple to hack something out. The problem is, I don't want to hack and I want to have something that's simple and easy to maintain.

    Read the article

  • Unable to load detached NIB in View

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • AddObjectsFromArray does not work properly

    - by Sheehan Alam
    I have two NSMutableArrays: NSMutableArray* currentMessages NSMutableArray* items I am trying to copy the contents of items into currentMessages as such: [self.currentMessages addObjectsFromArray:self.items]; When I am debugging self.items contains 30 objects. After this operation self.currentMessages contains 0 objects. Why is the copy not working?

    Read the article

  • View load methods not firing.

    - by 4thSpace
    I'm loading a view like this: if(commentSubmissionView == nil){ commentSubmissionView = [[CommentSubmissionController alloc] initWithNibName:@"CommentSubmissionView" bundle:nil]; } [self.view addSubview:commentSubmissionView.view]; viewDidLoad and viewWillAppear in commentSubmissionView do not fire. Is there something else I need to do?

    Read the article

  • Always center UIView

    - by bresc
    Hi, I have a small UIView that should appear always in the center of the screen. This works great for portrait mode but does not in landscape. To draw the UIView I use: myView.frame = CGRectMake((visibleArea.size.width - MY_VIEW_WIDTH) / 2, (visibleArea.size.height - MY_VIEW_HEIGHT) / 2, MY_VIEW_WIDTH, MY_VIEW_HEIGHT); myView.autoresizingMask = ( UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin ); Any ideas what might be missing?

    Read the article

  • Loading a Reusable UITableViewCell from a Nib

    - by Greg Martin
    I am able to design custom UITableViewCells and load them just fine using the technique described in the thread found at http://forums.macrumors.com/showthread.php?t=545061. However, using that method no longer allows you to init the cell with a reuseIdentifier which means you have to create whole new instances of each cell at every call. Has anyone figured out a good way to still cache particular cell types for reuses, but still be able to design them in Interface Builder?

    Read the article

  • EAGLView orientation changes and strange buffering

    - by Drew
    I'm writing an app that offloads some heavy drawing into an EAGLView, and it does some lightweight stuff in UIKit on top. It seems that the GL render during an orientation change is cached somewhere, and I can't figure out how to get access to it. Specifically: After an orientation change, calling glClear(GL_COLOR_BUFFER_BIT) isn't enough to clear the GL display (drawing is cached somewhere?) How can I clear this cache? After an orientation change, glReadPixel() can no longer access pixels drawn before the orientation change. How can I get access to where this is stored?

    Read the article

  • What is NSString in struct?

    - by 4thSpace
    I've defined a struct and want to assign one of its values to a NSMutableDictionary. When I try, I get a EXC_BAD_ACCESS. Here is the code: //in .h file typedef struct { NSString *valueOne; NSString *valueTwo; } myStruct; myStruct aStruct; //in .m file - (void)viewDidLoad { [super viewDidLoad]; aStruct.valueOne = @"firstValue"; } //at some later time [myDictionary setValue:aStruct.valueOne forKey:@"key1"]; //dies here with EXC_BAD_ACCESS This is the output in debugger console: (gdb) p aStruct.valueOne $1 = (NSString *) 0xf41850 Is there a way to tell what the value of aStruct.valueOne is? Since it is an NSString, why does the dictionary have such a problem with it? ------------- EDIT ------------- This edit is based on some comments below. The problem appears to be in the struct memory allocation. I have no issues assigning the struct value to the dictionary in viewDidLoad, as mentioned in one of the comments. The problem is that later on, I run into an issue with the struct. Just before the error, I do: po aStruct.oneValue Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 0x9895cedb in objc_msgSend () The program being debugged was signaled while in a function called from GDB. GDB has restored the context to what it was before the call. To change this behavior use "set unwindonsignal off" Evaluation of the expression containing the function (_NSPrintForDebugger) will be abandoned. This occurs just before the EXC_BAD_ACCESS: NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"MM-dd-yy_HH-mm-ss-A"]; NSString *date = [formatter stringFromDate:[NSDate date]]; [formatter release]; aStruct.valueOne = date; So the memory issue is most likely in my releasing of formatter. The date var has no retain. Should I instead be doing NSString *date = [[formatter stringFromDate:[NSDate date]] retain]; Which does work but then I'm left with a memory leak.

    Read the article

  • UITextFields losing values after UINavigationController activity

    - by Dan Ray
    This is going to be hard to demonstrate in code, but maybe you can picture it with me. I have a view that contains two UITextFields, "title" and "descr". That same view contains two UIButtons that push another controller onto the navController to get more detail from the user about the object we're assembling and ultimately uploading to my server. It appears that pushing another view on, doing something, and popping it back off results in the two UITextFields keeping their content VISUALLY, but the .text property of those fields becomes NULL. I've confirmed that if I do my two push-pop fields before filling in those UITextFields, I get my data when I upload, and if I do them in the opposite order, I don't. It LOOKS like there's data there, but I get nothing when I NSLog their .text properties. Is this normal? Do I need to just design around this? Or is this as weird as it seems, and I should be looking deeper at causes of this?

    Read the article

  • to print local xml file through NSData?

    - by senthilmuthu
    hi, i want to take some xml data from local path,and to parse,but when i use following code NSLog returns(content) different texts which is differed from xml file, how can i get exact xml data to check ,it consists correct xml data or not? any help please? when i parse , it returns nothing..i have saved the file as .xml and copied to local resource folder? NSString *xmlFilePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"samp.xml"]; NSString *xmlFileContents = [NSString stringWithContentsOfFile:xmlFilePath]; NSData *data = [NSData dataWithBytes:[xmlFileContents UTF8String] length:[xmlFileContents lengthOfBytesUsingEncoding: NSUTF8StringEncoding]]; NSString *content=[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding]; NSLog(@"%@",content);

    Read the article

  • Custom Alert view

    - by Viral
    hi, I want to create a custom alert view, i.e. i want to put some images and my choice color on alert view, i know how to create normal alert view, but can any one help me out in this one??? so that the application will look pretty good. regard viral.

    Read the article

  • How to make a Global Array?

    - by Wayfarer
    So, I read this post, and it's pretty much exactly what I was looking for. However... it doesn't work. I guess I'm not going to go with the singleton object, but rather making the array in either a Global.h file, or insert it into the _Prefix file. Both times I do that though, I get the error: Expected specifier-qualifier-list before 'static' and it doesn't work. So... I'm not sure how to get it to work, I can remove extern and it works, but I feel like I need that to make it a constant. The end goal is to have this Mutable Array be accessible from any object or any file in my project. Help would be appreciated! This is the code for my Globals.h file: #import <Foundation/Foundation.h> @interface Globals : NSObject { static extern NSMutableArray * myGlobalArray; } @end I don't think I need anything in the implementation file. If I were to put that in the prefix file, the error was the same.

    Read the article

  • how to retrieve image from sqlite3?

    - by summer
    sorry guys..i know i had been asking alot of question..but ironically few has given me solution, and so now i really need a solution to the final part of my app?how to i retrieve image from sqlite to be display in the uiimageview?with conversion... NSData *imgData = [[NSData alloc] initWithBytes:sqlite3_column_blob(selectstmt, 3) length: sqlite3_column_bytes(selectstmt, 3)]; snap2playObj.snapImage = [UIImage imageWithData:imgData]; do i do it the normal way or do i need to convert it back to some string or something?kinda no clues..need some example or solution..and i wanna display it in my detailview

    Read the article

< Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >