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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-25-2011, 11:33 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: North America
Posts: 53
shimmy is on a distinguished road
Default Using Apple's AccelerometerGraph in modal view causes crash

My application uses files from Apple example code called AcceleromterGraph (see file GraphView.m). I included the graph view in a modal view controller and on my device the app crashes every time I dismiss the view controller. Using NSZombie it says that "-[GraphViewSegment isKindOfClass:]: message sent to deallocated instance 0xaeee00" and crashes inside the dealloc method for that class, which is inside the GraphView.m

I don't really know why it's doing this. I guess the code wasn't really written for usage in a sub-view like this. It seems like the view is trying to deallocate or communicate with elements of the graph view after they have been deallocated.

I have a GraphView* graphView as a member of my view, which is being initialized through the nib file, not in code. The graphView is connected properly because the data from the accelerometer shows up properly. Any clues? Anything else I should include here?
shimmy is offline   Reply With Quote
Old 07-28-2011, 08:47 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: North America
Posts: 53
shimmy is on a distinguished road
Default bump?

any thoughts?
shimmy is offline   Reply With Quote
Old 07-28-2011, 10:04 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: North America
Posts: 53
shimmy is on a distinguished road
Default viewwilldisappear fix?

Well, my fix right now was to release the view inside "ViewWillDisappear" instead of "ViewDidUnload" etc. because I suppose iOS will retain those views otherwise? Seems to avoid the crash... not sure if it's a clean fix though.

EDIT: never mind, doesn't work

EDIT 2: Ooops. I was forgetting to set the accelerometer delegate to nil when I was finished. n00b moment. For memory purposes, should I re-set the accelerometer's delegate to nil every time I pause data collection?

Last edited by shimmy; 07-28-2011 at 10:21 PM.
shimmy is offline   Reply With Quote
Reply

Bookmarks

Tags
accelerometer, accelerometergraph, graph, graphview, memory

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 404
16 members and 388 guests
7twenty7, blasterbr, buggen, chiataytuday, Clouds, dre, fiftysixty, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, n00b, nyoe, pungs, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,668
Threads: 94,121
Posts: 402,902
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jonathandeknudt
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:59 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0