The example for one of the exercises in the book I am reading shows the following code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int input, reverse, numberOfDigits;
reverse = 0;
numberOfDigits = 0;
NSLog (@"Please inp...
in function signatures, like:
- (void)dealloc
?
thanks :)
...
My application always crashes if I use the camera to take a picture while connected to a 3G connection (not wifi).
When I use wifi then it run perfectly.
What is this problem ?
...
This is probably a completely stupid question, but i'm pretty new at objective-C and programing in general.
i'm trying to make an array of arrays but can't manage to make it work :
@interface ArraysAndDicts : NSObject {
NSMutableArray * mySimpleArray;
NSMutableArray * myComplicatedArray;
}
the implementation :
-(void)generateValueF...
I am trying to change the class of objects created with a nib with the iPhone SDK.
The reason for this is; i dont know until runtime what the class is that i want the nib object to be (though they will have the same UIView based super class), and i dont want to create a different nib for every eventuality - as the .nib will be the same ...
I am using two views (portraitView and landscapeView) loaded from xib in a viewcontroller for different InterfaceOrientation each for Portrait and Landscape mode. The view in portrait mode has statusbar and navigationbar and other one has just the navigationbar. The problem is that even i made statusbar hidden programatically the view in...
Hi,
Every the example I find on the internet (including Apple doc) sets the target to self like this :
[NSThread detachNewThreadSelector:@selector(threadedTask) toTarget:self withObject:nil];
Since i would like to do a more complex task in background (involving multiple methods), I thought of creating a class Task called like this :
...
How to Call drawRect programmatically in objective c ?
I want to call drawrect method of a view in my UItabbarcontroller. How i can do this ? Thanks in advance..
Edit
I have to call when the view is not visible currently. It will be the first time i have to call that view
...
Hi,
I try to create an UITableView similar to the Standard Contact App, when selecting a contact (i.e. grouped style). But how do I get some controls at the top or at the bottom of the cells, which scroll with the rest? In the Contact App you have at the top the picture together with the name and at the bottom three buttons. Are these j...
Hi Guys,
I need to dispaly the email address from left side of a UIButton, But it is getting in the center.
Is there any way to set the alignment to the left side of a UIButton.
UIButton* emailBtn = [[UIButton alloc] initWithFrame:CGRectMake(5,30,250,height+15)];
emailBtn.backgroundColor=[UIColor clearColor];
...
Hi,
could you tell me please - which object and which method can i use to fetch information about installed applications on OSX with objective c or macruby?
...
I have noticed in some of my older apps that in situations where I have added a custom View Controller I have not changed the View Controller class in the application delegate. For example, below I have created a CustomViewController class but have declared viewController as UIViewController.
@interface ApplicationAppDelegate: NSObject ...
The recent article of steve jobs link
made me think about the future of flash. I'm learning actionscript 3.0 in my studies but is it the right decision still to go for it? I was pretty sure that I will be able to build application in as3 for iphones/ipads in the near future. It seems to me, while I would stay with flash, the market will ...
In my past applications I have been #importing into my *.h files where needed. I have not really thought much about this before as I have not had any problems, but today I spotted something that got me to thinking that maybe I should be #import-ing into my .m files and using @class where needed in the headers (.h) Can anyone shine any li...
In almost all of the books I read and examples I go through I see pointers initialized this way. Say that I have a class variable NSString *myString that I want to initialize. I will almost always see that done this way:
-(id)init {
if (self = [super init]) {
NSString *tempString = [[NSString alloc] init];
self.myS...
This is my drawInContext method:
UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myImage" ofType:@"png"]];
CGRect cropRect = CGRectMake(0, 0, 175, 175);
CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], cropRect);
CGRect imageRect;
imageRect.origin = CGPointMake(0, 0);
imageRec...
Hi,
-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "TwitterDrilldownView"
I get the above error when I push a new ViewController onto the navigation stack. This is the push code,
[self.navigationController pushViewController:[[[TwitterDrilldownViewController alloc] initWithTwitterAnnotation:temp] aut...
I wonder how to save the UIImage object from UIImagePickerController into the App Document directory. I tried to use UIImageJPEGRepresentation() method and UIImagePNGRepresentation(), but it seemed the image data was changed. Is there any method to keep the original image content without any compression?
...
In my CoreData Application, I've an outline view on left of main window, acting as source list (like iTunes); on the right I display a proper view, based on outline selection.
Each view has its components, such as table view, connected to array controller, owned by the specific view.
Very often different views display same data, for exam...
I am trying to make Twitter work in my app and everything works fine except the code does not seem to recognize an error from Twitter. If the username/password are not valid, I get an error message through this function:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
NSString* strData = [[[NSString al...