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 02-12-2011, 05:24 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 10
arfius is on a distinguished road
Default initialization of UIIMage into touchesBegan

hi @ all,
I have the follow problem:
I declared in my interface section of header file a image UIIMage * myimage;

In the touchesBegan into the .m file, I initialize
the myimage using


Quote:
UIGraphicsBeginImageContext(viewDisegno.frame.size );
[myimageview.image drawInRect:CGRectMake(0, 0, myimageview.frame.size.width, myimageview.frame.size.height)];

myimage=UIGraphicsGetImageFromCurrentImageContext( );
UIGraphicsEndImageContext();
..
After I use the variable myimage in a method IBACTION to set the image of a UIImageView :
myimageview.image=myimage;
Now I receive a signal: “EXC_BAD_ACCESS”

Thanks for your help
Arfius

Last edited by arfius; 02-12-2011 at 05:32 AM.
arfius is offline   Reply With Quote
Old 02-12-2011, 05:49 PM   #2 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Check the docs:
UIKit Function Reference

Return Value: An autoreleased image object containing the contents of the current bitmap graphics context.

The image is probably getting autoreleased before you use it. You need to retain it until you use it, and then release it.
__________________

Free Games!
smasher is offline   Reply With Quote
Reply

Bookmarks

Tags
initialization, touchesbegan, uiimage

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: 375
15 members and 360 guests
blasterbr, buggen, Clouds, dre, EvilElf, jeroenkeij, jimmyon122, LEARN2MAKE, Mah6447, n00b, nyoe, pungs, Sami Gh, stanny, toon4413
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,121
Posts: 402,900
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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