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 02-15-2010, 08:10 AM   #3 (permalink)
djp_phillips
Registered Member
 
Join Date: Feb 2010
Posts: 83
djp_phillips is on a distinguished road
Default

Hi, thanks for the info, I already came across that forum post, it doesn't really help me if I'm honest, I think I have isolated my problem however, it seems storing Dictionaries as objects inside a dictionary is no problem, the problem is only when I try to store a struct, and I think it's something to do with he memory of the struct.

Here is a sample of what I am doing:

This is my struct
Code:
typedef struct{
	NSMutableString *value;
	NSDictionary *attributes;
} xmlElement;
In a method of my class I have:
Code:
	xmlElement elem;
	elem.value = nodeValue;
	elem.attributes = nodeAttributes;
	[nodeValues setObject:elem forKey:xmlPath];
* nodeValues is a NSMutableDictionary and xmlPath is an NSMutableString

I think that maybe, I need to specify retain for the elem ?

<SOLUTION>
I had to convert the C-struct to objectif C with the NSValue class, and use getValue on that to retrieve the struct.

Last edited by djp_phillips; 02-15-2010 at 02:54 PM. Reason: Found solution
djp_phillips is offline   Reply With Quote
 

» Advertisements
» Online Users: 770
19 members and 751 guests
7twenty7, alexeir, antonwilliams, AppAnnex, Clouds, daarshg, dansparrow, haihung_kt, Hannibal2010, manop_cs, mishti, policy1, raymng, Robiwan, shellytf96, Sophie100, Trixlean2012, upultharanga685, ziocleto
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,477
Threads: 94,040
Posts: 402,626
Top Poster: BrianSlick (7,978)
Welcome to our newest member, Trixlean2012
Powered by vBadvanced CMPS v3.1.0

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