Objective C - NSNumber, NSInteger, ...
What's the difference between NSNumber and NSInteger? Are there more primitives like these that I should know about/use? Is there one for floats? ...
What's the difference between NSNumber and NSInteger? Are there more primitives like these that I should know about/use? Is there one for floats? ...
In my UIViewController subclass should I initialize the NSArray of data for the UIPickerView in init or in viewDidLoad and why? Thanks. ...
Hi I am using the simple SMTP client code, first posted on google code at: http://code.google.com/p/skpsmtpmessage/ That repo seems to have gone unmaintained, as the project owner is now employed at apple, and maybe has better things to do. There is a fork of the code, that is more recently maintained at github, which you can find at...
iPhone Objective C: How to get a pixel's color of the touched point on an UIImageView, even if the parent UIView or itself is being rotated by the CGAffineTransformMakeRotation function? Will the view property of the UITouch still correctly return the correct pixel of the touched point even if the UIView/UIImageView is being scaled and ...
I would like to write a UIView subclass that, among other things, colors whatever's underneath it a certain color. This is what I've come up with, but it unfortunately doesn't seem to work correctly: #import <UIKit/UIKit.h> @class MyOtherView; @interface MyView : UIView { MyOtherView *subview; } @end @implementation MyView - (id)...
Hi I dont understand of the below case of converting int to byte , the below java code can able to print the byte value as below System.out.println("binary output ::: "+Byte.toString(bo[0])); System.out.println("binary output ::: "+Byte.valueOf(bo[1])); System.out.println("binary output ::: "+Byte.valueOf(bo[2]));...
My piece of code is... window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; window.backgroundColor = [UIColor blackColor]; CGRect rect = CGRectMake(0,0,320,480); view = [ [ UIView alloc ] initWithFrame:rect ]; view.backgroundColor = [UIColor blueColor]; [window addSubview:view]; // Override point for customizat...
I think I am missing something obvious somewhere. I have a (CLLocation *)lastqueriedlocation defined in the header as a property and synthesized. I want to updated it in locationManager:didUPdateToLocation:fromLocation: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CL...
I'm using an NSRange (a struct) and initializing it like this: @interface MyViewController : UIViewController { NSRange currentRange; } NSRange has a location and length field. How can I check to see if the struct has been initialized with a value? I tried: if (myRange.length == nil) but the compiler complained about comparing...
Hello all , I have a question concerning hiding ,removing or adding a UIBarbuttonItem on UIToolbar. I have a UIToolbar and two items. I wish to hide an item on the toolbar and when I enter for example third UITableview it will appear. I've put this code in my viewDidload instruct = [[UIBarButtonItem alloc] initWithImage:[UII...
I've got a big UIView that responds to touches, and it's covered with lots of little UIViews that respond differently to touches. Is it possible to touch anywhere on screen and slide around, and have each view know if it's being touched? For example, I put my finger down on the upper left and slide toward the lower right. The touchesBe...
I can't seem to find any documentation on the Objective-J language itself. Does it support @protocol like Objective-C? Is there a language spec somewhere I'm missing? ...
Hey guys, I have a general question about writing init methods in Objective-C. I see it everywhere (Apple's code, books, open source code, etc.) that an init method should check if self = [super init] is not nil before continuing with initialisation. The default Apple template for an init method is: - (id) init { self = [super in...
Does anyone know how to cancel (resign First Responder) out of a UISearchBar when you tap below the search text box and above the keyboard? Can anyone help post some code to handle this? Thanks ...
I'm having a severe memory leak issue with my program. I'm using Apple's Instruments to track my leaks, and in the first few seconds after my app starts there are hundreds and hundreds of leaks listed. The problem is none of them seem to tell me where the leak is coming from. I've gone through all my classes and made sure that anything ...
I'm trying to mock a method that has the equivalent of the following signature: - (NSDictionary *) uploadValues:(BOOL)doSomething error:(NSError **)error I want it to return a small dictionary so that my test can make sure the code uses the dictionary properly. however, no matter what i do OCMock always returns nil from the method, r...
Ok, so I’m having this problem. What I want to do is manually add multiple annotations to a map. When I add just one annotation, it works flawlessly. The pin drops, you can click on it to see its callout, life is good. The problem comes when I want to add more than one. When I add the second, suddenly the pin’s aren’t coloured correctly...
Hi, I'm using this method by Dave DeLong to calculate the size of a folder using the Carbon File Manager API: http://github.com/davedelong/BuildCleaner/blob/b2712242b4eea1fff0e78a08b393a417e3019c8a/NSFileManager+FileSize.m (Its the first method there) The issue I'm having is that some folders (.app bundles in my case) are not reporti...
Hi I have this code -(void)setUserFilters{ //init the user filters array userFilters = [[NSMutableArray alloc] init]; SearchCriteria *tmpSc= [[SearchCriteria alloc] init]; for(int i=0;i<[searchFilters count];i++) { tmpSc=[self.searchFilters objectAtIndex:i]; if(tmpSc.enabled==TRUE) [userFilters addObject:tmpSc]...
I've got an app with a webview. It was working great, and then I moved the webView into an NSSplitView. Now it seems for some reason that whenever I press any key to enter text into the webview, it scrolls down. I haven't a clue as to what could cause this. Please help! ...