Ok, if you take a look at my two previous posts (Link #2 in particular), I would like to ask an additional question pertaining to the same code. In a method declaration, I am wanting to define one of the parameters as a pointer to an array of pointers, which point to feat_data. I'm sort of at a loss of where to go and what to do except t...
Malloc like this
int **terrain;
terrain = malloc(sizeof(int*) * mapSize.x);
for (int i = 0; i < mapSize.x; i++) {
terrain[i] = malloc(mapSize.y * sizeof(int));
}
Use it.
Convert to NSdata like this before saving
NSData *data=[NSData dataWithBytes:terrain length:(30*sizeof(int*) +30*30*sizeof(int) )];
[rootObject setValue:data ...
Objective-C newbie question. Given the following (fictional) code:
id mysteryObject = [anotherObject mysteriousMethod];
How can I determine at runtime what class mysteryObject is?
...
I don't know how to make an if-else statement within an IBAction! I can only make them in the button clicks... what I want it to do is check for which # the int question is at and make the appropriate changes. please help!
MainView.h
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface MainView : UIView{
IBOutlet U...
My application is a tab bar application, with a separate view controller for each tab.
I have an object in my first view controller (A) which contains all my stored application data (Please ignore NSUserDefaults for this) which needs to be accessed by the second view controller (B) when I press a button on it. How can I achieve this cou...
Hi,
I've come from a java background, so i'm still getting to grips with some of the ways of doing things with Obj-C.
Depending on a number provided, I want an NSString variable to have different contents.
In java I would do something like this:
string foo;
switch (numberToSwtich){
case 1:
foo = "Something!";
break...
Hi All,
I have created a static library following this link.
But I am facing Problems in using the library. For reference on how to use static libraries in an iPhone project I followed this link .
But I am stil struggling with the "How to implement static libraries in any other iPhone project?" question.
Thank you all.
...
I want to programatically create a dictionary which feeds data to my UITableView but I'm having a hard time with it. I want to create a dictionary that resembles this property list (image) give or take a couple of items.
I've looked at "Property List Programming Guide: Creating Property Lists Programmatically" and I came up with a small...
I have a tableivew with a bunch of cells and I am trying to get the uilabel to display more than 3 lines. I set the linebreakmode and the numberoflines appropriately, but it's still not displaying more than three lines. Any suggestions? The table cell automatically adjusts its height to accomodate the number of chars/lines, but the text ...
I am trying to figure out how to do either nested arrays or multidimensional array for iPhone SDK programming using objective-c.
My data would be something like this, 3 columns and rows from 10 to 50.
name department year
John Sales 2008
Lisa Sales 2009
Gina Support 2007
Any help is apprec...
I am having trouble assigning the value of an NSString to a char * within a structure of a singleton class. The following is a simplification of my problem. My code utilizes more fields in the structure and passes more NSStrings.
Say I have a singleton class "SingletonClass" with a structure (I've done my homework with the Apple Documen...
With the iPhone SDK:
I have a UIView with UITextFields that brings up a keyboard. I need it to be able to:
Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard is brought up
Automatically "jump" (by scrolling up) or shortening
I know that I need a UIScrollView. I've tried changing the ...
Hello all,
I have multiple views in my application with respective view controllers. What I am doing is as follows.
Here is the more illustrative code:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
View1Controller *viewController1 = [[View1Controller alloc] initWithnibName:@"View1"];
View2Controller *viewC...
I need to develop a simple document-based application but using only one window, the documents should open in views separated by tabs.
How can I achieve it?
...
I really need some clarification — I have a few questions and I'm all mixed up right now.
Here is a simple class interface:
#import <UIKit/UIKit.h>
@interface Car : NSObject{
NSInteger carID;
NSString *carName;
}
@property (nonatomic, assign) NSInteger carID;
@property (nonatomic, copy) NSString * carName;
@end
Why is carI...
I want to create a view with some controls inside, a text field and some buttons, and I want to duplicate this to show them as content of a tab in a tabview.
Each tab must has an instance of this view.
Directions?
...
I am working on an iPhone application. When the application starts I authenticate, establish a Restful connection, get data in form of XML file, parse it and then display it in form of table view.
Here is my problem.
If the user information is already stored on the application or if it is hard-coded in the code, the application takes t...
I'm testing a new iPhone app with my end-users and found that a lot of times they misses the clickable area of a UITableCell and perform the wrong action. (Some users never before use any kind of computer!).
Then I try myself and found that still I can fail sometimes. So I wonder how increase the tappable area of the cell with accessory...
Possible Duplicate:
Placement of the asterisk in Objective-C
Could someone please shed some light as I am a bit confused as to the proper use of the indirection operator.
Example:
NSAutoReleasePool * pool = [[NSAutoReleasPool alloc] init];
MyAwesomeClass *awesomeClass;
So as I see them; are they just stylistic differences on...
I am porting a Windows application to OSX and need to get user's home, documents and music directories. It is done on Windows using a SHGetFolderPath WinAPI call.
How can I do it in OSX, preferably without resorting to Objective C?
If I can't do it without Objective C, how can I do it at all?
...