Objective-C Programming

180

Solutions

207

Contributors

Objective-C is an object-oriented programming language that is a strict superset of C (any valid C code is equally valid Objective-C code), and it inherits its object-oriented capabilities from Smalltalk. All procedural syntax is identical to that of C, and all object-oriented syntax is an implementation of Smalltalk messaging. It is the main programming language used by Apple for OS-X and iOS and their respective APIs/ Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am new to xcode 4.2.1 and I am slowly trying to learn how to use it.  

I am working on creating a simple table view but I am having a strange problem.

The problem is when I create a new plist file but if I use the sample plist file in the class project it works just fine.

Now I know what you are probably thinking, why don't I use the sample file from the class and move on to the next project.  Because the scope of the project was to learn how to create a simple table view along with knowing how to create a new plist file.  

The sample file is only there to show you how the finish product should look like.

This is what I have tried so far to trouble shoot this problem.

I have copied the sample plist file and renamed it to something else (test.plist) and deleted all the data in the file and entered my own.  Once I did this I edited my viewcontroller.m file and under the -(void) viewDidLoad and made the following changes.

{
NSString *myfile = [[NSBundle mainBundle]
                        pathForResource:@"test" ofType:@"plist"];
      myplists = [[NSArray alloc] initWithContentsOfFile:myfile];
                     
    [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
}

When I finished doing this I saved, build and ran the project and the iOS Simulator launched with my own data in the table view.  

No problem here.

The problem is when I create my own plist (test2.plist), I do this exactly how the instructor in the …
0
I have an application written in Visual C++ MFC with a lot of old code. A number of clients have requested a Mac version of the application. They are not interested in installing Windows on an Intel Mac nor do they wish to utilize Boot Camp, VMware Fusion or Parallels Desktop. They are true Mac diehards.

I know that Cold Warrior has discontinued the development of resources that would compile either Windows or Mac versions of the core code of a program while integrating the appropriate libraries for each OS.

Is there anything out there to replace Code Warrior? Something that would be able to convert Windows Visual C++ with MFC to code, including the corresponding libraries, that then could be compiled for MAC OS Classic and OS X?

Also, is MAC OS X as dependent on OOP and a grand event loop for controlling an application's operation as it was in the past? Is the underlying logical structure of Windows software and MAC software still so foreign to each other that I would end up having to tear apart and rewrite much of the Windows code in order for it to conform to the MAC?

Thank you for your time,
SilverJade
0
I have an application written in Visual C++ MFC with a lot of old code. A number of clients have requested a Mac version of the application. They are not interested in installing Windows on an Intel Mac nor do they wish to utilize Boot Camp, VMware Fusion or Parallels Desktop. They are true Mac diehards.

I know that Cold Warrior has discontinued the development of resources that would compile either Windows or Mac versions of the core code of a program while integrating the appropriate libraries for each OS.

Is there anything out there to replace Code Warrior? Something that would be able to convert Windows Visual C++ with MFC to code, including the corresponding libraries, that then could be compiled for MAC OS X?

Also, is MAC OS X as dependent on OOP and a grand event loop for controlling an application's operation as it was in the past? Is the underlying logical structure of Windows software and MAC software still so foreign to each other that I would end up having to tear apart and rewrite much of the Windows code in order for it to conform to the MAC?

Thank you for your time,
SilverJade
0
I am new to Xcode 4 and I am following an old training video from lynda.com.  In the training video the instructor is referring to a folder within the IDE which does not exist in Xcode4.  The folders name is called resources and I can't find it, any ideas would be appreciate.
0
I am new to the Xcode 4 IDE and I ran into a problem which is an annoyance.

When I create a new project and click (single click) on any of the files (Viewcontroller.h, *.m, *.xib) the files open within the IDE.  No problem here, but if I click on the same file again rather than opening the same window within the IDE it opens a new window.

You may say whats the problem?

The problem is if you are using gestures like I am using within Xcode 4 this starts to build up.  So the problem is that I have several windows open of the same file and I don't know how to remove the view or window of this file.

Remember this is within the Xcode 4 IDE, so there is no radio button to 'X' out.

Any ideas on how I can remove this window or configure Xcode 4 to open the same window rather then created a new one?
0
Greetings;

I am a veteran programmer, however, I am only beginning to learn Objective-C to create applications for Apple's iPad.

The application I am currently working on involves images. I am looking for direction as to the methods and properties required to transition from one image to the next. The effect I am looking for is to move to an adjacent image smoothly by using a finger type gesture to slide one image out while the next image slides into place.

I will provide code to ensure an image is available to scroll to once I gain a better understanding of how I might code the transition effect.

Any assistance you would provide is appreciated.


Thank you ... David
0
I am new to Xcode 4 and I am slowly trying to learn how to use the IDE.  My question is regarding debugging and trouble shooting code.  I purchased this online training program through Lynda.com which is pretty good.  The only problem is that the entire online course is on Xcode 3.  It has been a little difficult trying to keep up with the course since it is one rev behind but I have been managing so far.

Any way, my question relates to zombieStarter, I can't seem to find any reference to this in Xcode 4.  Has this functionality been removed from Xcode 4 IDE?
0
Hello experts,
I need to create an iPad app that will download some customer records from our database (such as through our .net web server), let our field agents take a photo and update each record, and then sync back up to our customer database when they're connected through VPN.

How would something like that work? Should I use a SQLite3 database on the iPad to download the customer records? Then use the UIImagePickerController to save the photo onto the iPad? Then how do I get that data synced back up to the customer database?

Thanks. Any advice or links to additional reference material is greatly appreciated.
0
I created my first test Console App in XCODE and tried to create a NSAutoreleasePool but it's not available.


NS_AUTOMATED_REFCOUNT_UNAVAILABLE


It's marked explicitly unavailable.

Any idea why?

Thanks.
0
I would like develop a VOIP iPhone application using Objective C. (Similiar to Viber or Skype in iPhone) Can anyone provide any high level info about this sort of development? Which libraries can be used for such application? (both open source and licensed) What would be the typical challanges of such development? Thanks.
0
Hey,

       I've been trying to learn Objective-C, what I'm trying to do is pass a string to a class function, and have that function call some methods to start the map, ipod and phone application...

But for now, all I'm trying to do is pass in a string to a class and have it make a decision on what it received.

Here's what I got so far:
#import <Foundation/Foundation.h>

@interface Decision : NSObject
{
    /*
     Maps
     Cell
     iPod
     */
    NSString *value;
}

-(void) decisionMaker: (NSString*) command;
-(void) print;
@end

Open in new window

#import "Decision.h"

@implementation Decision

-(void) decisionMaker:(NSString*)command{
    NSString *call = [call initWithString:@"call"];
    NSLog(@"I work!");
    if([call caseInsensitiveCompare:command]){
        NSLog(@"Yes... I got \"call\"");
    }
}

-(void) print{
    NSLog(@"I DO WORK!");
}
@end

Open in new window

#import <Foundation/Foundation.h>
#import "Decision.h"

int main (int argc, const char * argv[])
{

    @autoreleasepool {
        Decision *myDecision;
        NSString *str = [str initWithString:@"call"];

        // insert code here...
        [myDecision decisionMaker:str];
        [myDecision print];
        
    }
    return 0;
}

Open in new window


But I'm not getting any output... could anyone please explain why its not working?

Thanks in advance!
0
Hey,

       I'm trying to learn how to program on the iPhone, so I was wondering if it was possible to control the built in iPod from a third party app.

If it is possible, could you please point me to a good tutorial that can help me make this?

Thanks in advance!
0
Is there an app that allowes me to design an app for an Iphone / Ipad Or maybe a site that you can use themes to customise (maybe for a small fee) online?
0
I understand that iPad development can be done using a simulator on a Mac.

I am NOT an Apple person. I have a LOT of development experience as a web developer & with databases.

I understand that Objective C or something called Monotouch can be used for development. Is that correct?

What are the specs (minimum requirements) for a Mac needed for development?

Thanks
0
In an iOS5 ARC project how do I build a structure that includes a date as ARC seems to complain about everything other than numbers in the structure.  I want a structure that I can put in to an array.
typedef struc {
int value1;
NSDate *value2;
} sss1;

Open in new window

0
Hi, I'm learning Objective-C and am having a little bit of a struggle with the concept of "Delegates."

I've programmed on other languages, such as VB.NET and some C#.NET, but I'm confused about how Delegates work (which I've seen mostly in iPhone programming) or why have them at all.

Could someone please provide a simple explanation of how and why Delegates are used?

Thanks you,
Fulano
0
What's the best way to create a Wi-Fi network profile with for iPad/iPhone using 'objective c'?

I've looked around but haven't found a good way to do this.

Thanks!
0
I can't work out how to determine when a row is clicked on a nstableview. A delegate method allows me to determine when a row is selected, but I can't see when a row is clicked. The reason I need to do this is because I need to determine when an already selected row has been clicked again. When developing for the iphone/ipad there is a tableView:didSelectRowAtIndexPath: however I can't find one for nstableview, which only has - (void)tableViewSelectionDidChange:(NSNotification *)aNotification, but it doesn't fire if you click an already selected row.

Any ideas?
0
I have a view controller with a button and a UIScrollview. Inside that scrollview are 2 UIViewControllers. Inside those view controllers are a bunch of UILabels and UITextFields. I need to be able to change the content inside the labels and pull data from the textfields. All the labels and textfields have been set up as properties of their respective UIViewControllers and wired up correctly in IB.

How would I go about doing this?
0
Screenshot

Hi all,
As you can see on the link above, I'm facing a problem with an iPhone app I'm building using mono touch.
The MainWindow.xib has a tab bar controller and on the first tab there the class causing the problem. This class is extending an UITableViewController. you can see the code here.
Basically the problem is this: The application starts and loads 2 tables. The first is showing some product's categories and the second some external links. If I click on any cell then another table view controller is pushed. If I'm on the second table view controller and I click on the first tab icon (the little blue ball you see on the image), what is shown on the third part of the image is happening: looks like the first controller is loosing all the content and I cannot figure out why and how to resolve. Hope my problem it's clear and more important someone can help me.

Thanks
0
i need to hide and show labels in referent situations using xcode objective-c i used to do this on .net like this
label.visible = false , how we can do the same using xcode?

Best regards
0
Is there any good way to create an iphone tutorial?  I have seen online a virtual iphone that the presenters demonstrate how to use their app.  Is there a tool I can download out there that will virtualize the iphone so I can screencast the application tutorials to my staff?

Thanks,

Tyler
0
I have a problem in my iPhone application. I'm loading points into a Google map. These points are generated from a remote JSON file. Data is loaded without problems the first time I start the application but when I select a row in the pickerview and want to change the active pins after the program is startet i get a lot of memory leeks and the program also crashes if i continue doing it. It happens when i execute this method:
[self loadMainData:@"http://mysite.com/json.php"];

I don't know why this command works the first time i load the application when the viewDidLoad method is executed but not anymore. I guess i need to empty the arrays or release the data or something? I'm hoping you experts have an idea what needs to be done and how to do it.
#import "MapperViewController.h"
#import "MyAnnotation.h"
#import "JSON.h"

@implementation MapperViewController

@synthesize mapView, btnFilter, btnRoute;

-(void) viewDidLoad
{
    [super viewDidLoad];
	
	pickerViewArray = [[NSMutableArray alloc] init];
	
	[self loadMainData:@"http://mysite.com/json.php"];
}

-(void) getJsonData: (NSString*)JsonURL
{
	//Define raw JSON string
	NSString *MyRawJson = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString: JsonURL]];
	
	if ([MyRawJson length] == 0) //If string doesn't contain any value
	{
		return; //Stop execution
	}
	
	SBJSON *parser = [[SBJSON alloc] init]; //Create parser
	list = [[parser objectWithString:MyRawJson error:nil] copy]; //Parse string
	
	[parser release];

Open in new window

0
I have an iPhone app up and running on a physical phone.

I have my own subclassed implementation of a UIViewController, with init() and viewDidLoad() overridden and declared like this:

- (id)init;
- (void)viewDidLoad;

When I set breakpoints at init() and viewDidLoad() and run the app, gdb breaks at viewDidLoad(), but not init().  init() appears not to be called at all.  In fact, farther down in the execution, variables that are supposed to be assigned in init() are still unassigned.

Any thoughts?  Explanations?

- Thanks
0
I'm frustrated with PC's and I'm thinking of getting an iMac. I want to create music programs, and iPad programs. I'm mainly focused on MIDI controllers, not fancy virtual synths, although that would be great if I could do that too.

Can someone prove to me that I will be able to do this?  I know C#, and I'm willing to learn whatever language as long as it's not extremely difficult compared to C# or VB.NET, and I have something like Visual Studio and it's not way too expensive (otherwise I would hire a programmer to do the job). Preferrably if I could do this in Basic, but I understand those limitations.

So the considerations are: Cost, ease of implementation (not hacking around), and ease of transition from Visual Studio to Mac platforms.
0

Objective-C Programming

180

Solutions

207

Contributors

Objective-C is an object-oriented programming language that is a strict superset of C (any valid C code is equally valid Objective-C code), and it inherits its object-oriented capabilities from Smalltalk. All procedural syntax is identical to that of C, and all object-oriented syntax is an implementation of Smalltalk messaging. It is the main programming language used by Apple for OS-X and iOS and their respective APIs/ Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods.

Top Experts In
Objective-C Programming
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!