objective-c

iPhone Global Variable?

Hi I have two views with their own .h and .m files of course. How can I declare a bool (or any variable for that matter) in one view and be bale to access it in another view? Thanks. ...

How to retrieve multiple records from table?

I have a table having data. id type 1 max 1 sam 1 rom 2 jak I want to retrieve all the type where id=1; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { while(sqlite3_step(compiledStatement) == SQLITE_ROW) { NSString *aRecord = [NSString stringWithUTF8String:(...

UITextField help in iPhone (HTTP and HTTPS validation)

Hey All, I am developing an app and the user has to enter the URL to access the information in the app. If the user forgets to enter the URL in a proper way, I want to prepend http:// and append soap.php to the URL text field. Is there any validation to be done for this or can I append using string methods? Also is there a way to allow ...

String Encryption in Objective C

I have to encrypt the username and password for a native Apple application. But the server side is in Java, so the same encrypted fields have to be decrypted using Java. I am new to cryptography, and I don't know how to go about it. One option that has come to my mind is to take any algorithm in Java, understand the source code for encr...

WebView not showing in NSWindow

I am developing a C++ app and I need to display a NSWindow with a WebKit WebView inside it. I've coded up the Objective-C class which will manage creating and displaying the window but the WebView contained inside it does not display. Here is my code. Any idea on what is wrong and how I can fix it? I'm compiling the below code with $g++...

Objective-C how to get an image from a url.

Hi, Am having some difficulty getting an Image from a url, and then displaying it in an image well in the interface. This is the code I'm currently using, it doesn't work and compiles with no errors: NSURL *url = [NSURL URLWithString:@"http://www.nataliedee.com/061105/hey-whale.jpg"]; NSString *newIMAGE = [[NSString alloc] initWit...

CoreData how to detect new version of an app so I can update the model?

I have a very simple model that is created when the app is launched for the very first time and populated with the contents of a plist. I will need to re-create the model again when an update to the app is downloaded and launched. I know that you can version coredata models but I don't foresee the model itself is going to change. I will ...

what do I research?

I need to know what is happening when extra bits of information are passed around through method titles in xcode ie: - (CGPDFPageRef)pdfPage:(NSInteger)index { and - (void)configurePageP:(ISVportrate *)page forIndex:(NSUInteger)index{ when this happens it is a little annoying that I don't know whats going on or feel comfortable pas...

How can you write log files in Objective C?

If I'm doing mass operations inside objective C, and a lot happens in the console... I cannot see it all happen in windows. Instead of adding the argument ">>WriteLog.log" what would the proper way to log the console inside of Objective C? ...

NSArray creation with variable argument lists in Objective-C

myArray = [NSArray arrayWithObjects:aDate, aValue, aString, nil]; This array convenience method takes a comma-separated list of objects ending with nil. What is the purpose of the nil? ...

Handling touch event logic in Subview or ViewController

I have a series of UIView subclasses that are added as subviews. Each subview can be dragged and dropped. When they are dropped (touchesEnded), I need to run a method in the viewController to do some work. I currently have the touchEvents handled in each subview class. Should I be handling these touch events in the viewController or shou...

Deal with potential memory issue in iPhone

What ways are there to deal with memory issues on the iPhone? Is it possible to ask how much memory is available before jumping into a memory intensive section of code? (or perhaps Apple would just say that if you have to use so much memory you are on the wrong platform?) ...

iphone: how to block touches while showing some UIView

Hi, my current scenario is this -> i am showing a view controller that has a button. when i click that button a small view opens. now what i want. when that view is shown i don't want user to touch below that ( even in navigation bar's back button ). the same thing which UIAlertView does. how i can achieve that thing with my custom view...

track user input from UIKeyboard

How can I get user input of the UIKeyboard on the iPhone? I want to track, if the user hits "backspace" when the firstResponder UITextField is empty. I know how I can track a text change but if the field is empty the text don't change when hit "backspace". ...

Make an Image have rounded corners with Objective-C / pure C

Hi, How do you make an NSImage Image have rounded corners? I'm doing Mac Dev not iPhone dev. Thanks in advance. ...

Buttons make my multiview iphone app crash! (but single view is okay)

This is probably some rookie mistake, but I can't figure it out. I've established a button within my app to recall a link in safari. From my method file it looks like this: Obj C Code: -(IBAction)linkSafari{ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://en.wikipedia.org/"]]; } I linked it up in IB and all ...

Compatibility issues with package developed on OS X10.6.4 on older OS X

I am using Os X 10.6.4 and X code Version 3.2.3 for developing some simple app files and using PackageMaker to distribute these app files. But when trying to run the package on some other mac I am getting error that the package is not compatible with the Os X its running and file would not be installed. Is this a problem with X code or p...

UITableViewDataSource Done Loading Signal to UITableViewDelegate

I have separate files for the UITableViewDataSource and UITableViewDelegate I am implementing a 'Pull Down to Refresh' feature on a UITableView and wish to send a signal from the UITableViewDataSource to the UITableViewDelegate to stop the loading indicator from turning. I was wondering what the best way to send a signal between the U...

Im getting an EXE_BAD_ACCESS error with my NSTableView datasource methods. Can anyone tell me why?

Hi all, I decided to get back to Cocoa/Objective-C programming recently and my current project calls for an NSTableView. I thought I had gotten the process down to a Science but it appears I was wrong. I am getting an EXE_BAD_ACCESS error in the datasource method that actually returns the data. When I run the application, all results...

UITextField not showing when added as subview.

Hello. I'm making an Opengl ES application and I am trying to work out how to incorporate parts of the UIKit GUI over the view with the OpenGL ES working on it. In the init method of the EAGLView class I have this to setup the UITextField: add_name_field = [[UITextField alloc] initWithFrame: CGRectMake(10, 10, [UIScreen mainScreen].bo...