Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-31-2010, 09:51 AM   #14 (permalink)
dcjones
Registered Member
 
Join Date: Mar 2010
Location: Warwickshire, United Kingdom
Posts: 163
dcjones is on a distinguished road
Default

Hi Robert,

Sorry to be a complete pain in the neck with this.

My appDelegate .h file is:
Code:
#import <sqlite3.h> // Import the SQLite database framework
#import <UIKit/UIKit.h>

@interface iTravelv113AppDelegate : NSObject <UIApplicationDelegate> {
    
    UIWindow *window;
    UINavigationController *navigationController;
	
	// Database variables
	NSString *databaseName;
	NSString *databasePath;
	
	NSMutableArray *countries;
	
	NSString *airportname;
	
	
	
	NSMutableArray *arrayOfCharacters;
	NSMutableDictionary *objectsForCharacters;
	
	NSMutableArray *arrayOfAirports;
	
	// Array to store the country objects
	NSMutableArray *airports;	
}

@property (nonatomic, retain) NSMutableArray *countries;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;


-(void)checkAndCreateDatabase;
+(sqlite3*)getNewDBConnection;
The appDelegate .m file is:
Code:
#import <sys/socket.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <netdb.h>
#include <SystemConfiguration/SCNetworkReachability.h>

#import "iTravelv113AppDelegate.h"
#import "RootViewController.h"



@implementation iTravelv113AppDelegate

@synthesize window;
@synthesize navigationController;
@synthesize countries;
and so on...

I have a file which reads my SQL data and creates an ARRAY containing the record requested by the user. A part of the file is below:
Code:
// Create a new country object with the data from the database
Country *country = [[Country alloc] initWithName:aName countryName:aCountry capitalCity:aCapital
firstLang:aLanguageF secondLang:aLanguageS voltage:aVoltage freq:aFreq dialCode:aDialCode 
currencyCode:aCurrencyCode currencyName:aCurrencyName currencySymbol:aCurrencySymbol
phonePolice:aPhonePolice phoneMedical:aPhoneMedical phoneFire:aPhoneFire countryFlag:aCountryFlag
countryKey:aCountryKey countryOutletType:aCountryOutlet
timeZone1:atimeZone1 timeZone2:atimeZone2 timeZone3:atimeZone3];
			
// Add the country object to the countries Array
	[countries addObject:country];
	appDelegate.countries = countries;
	[country autorelease];
The part I am struggling with is assigning the content of the ARRAY to the "appDelegate.countries = countries". I know this is because I don't know how this is done even thou I have read and re-read your tutorial. Basically I am having a very thick head time.

Can you help me advance this issue a little further.
__________________
Many thanks, keep safe and well.



Dereck
dcjones is offline   Reply With Quote
 

» Advertisements
» Online Users: 371
11 members and 360 guests
Abimennicks, AyClass, Domele, esoteric, ipodphone, jakedukes3003, lancetusing, Newbie123, thephotographer, wenelecon, Wharazhasri
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,571
Threads: 94,081
Posts: 402,751
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Abimennicks
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:41 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.