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 08-17-2010, 06:04 AM   #1 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default Passing Varibales Error

Hey All

Im getting this annoying error and tried every i know but in this case it hasnt helped.

I have in my delegate....

Code:
vid_name = [push objectForKey:@"vid"];
(in the console .... vid = "video" )

now in my normal page i have

Code:
NSString *videoName = [(MissileAppDelegate *)[[UIApplication sharedApplication] delegate] vid_name];
			
NSString *path = [[NSBundle mainBundle] pathForResource:videoName ofType:@"mp4"];
when i run this and it comes to play the video, i get an error that doesnt even relate to the video, it happens with all variables i try and pass over using the [push objectForKey:@"vid"];. if i just vid_name =@"video" it works fine.

Any Ideas?

Alex
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 06:45 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
Hey All

Im getting this annoying error and tried every i know but in this case it hasnt helped.

when i run this and it comes to play the video, i get an error that doesnt even relate to the video, it happens with all variables i try and pass over using the [push objectForKey:@"vid"];. if i just vid_name =@"video" it works fine.

Any Ideas?

Alex
What is the error?
wuf810 is offline   Reply With Quote
Old 08-17-2010, 07:21 AM   #3 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

2010-08-17 13:19:44.873 APP[145:307] -[NSCFCharacterSet _fastCharacterContents]: unrecognized selector sent to instance 0x14eca0
2010-08-17 13:19:44.965 APP[145:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFCharacterSet _fastCharacterContents]: unrecognized selector sent to instance 0x14eca0'

but like i said, i get a different error for all different things i try.
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 07:32 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
2010-08-17 13:19:44.873 APP[145:307] -[NSCFCharacterSet _fastCharacterContents]: unrecognized selector sent to instance 0x14eca0
2010-08-17 13:19:44.965 APP[145:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFCharacterSet _fastCharacterContents]: unrecognized selector sent to instance 0x14eca0'

but like i said, i get a different error for all different things i try.
Ok things to try:

1) Just before your line "NSString *path = [[NSBundle mainBundle] pathForResource:videoName ofType:@"mp4"];", debug and actually check the contents of "path". Does it look correct? Can you paste the path in your reply

2) Instead of passing "videoName" in the above line, hardcode it @"video". If this works then you definitely know it is a path issue (which is what the errors are suggesting)

3) I know its a stupid question but is the video.mp4 file actually in the bundle and does it match what you are passing in for its name i.e. case sensitivity etc.
wuf810 is offline   Reply With Quote
Old 08-17-2010, 08:05 AM   #5 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

Quote:
Originally Posted by wuf810 View Post
Ok things to try:

1) Just before your line "NSString *path = [[NSBundle mainBundle] pathForResource:videoName ofType:@"mp4"];", debug and actually check the contents of "path". Does it look correct? Can you paste the path in your reply

2) Instead of passing "videoName" in the above line, hardcode it @"video". If this works then you definitely know it is a path issue (which is what the errors are suggesting)

3) I know its a stupid question but is the video.mp4 file actually in the bundle and does it match what you are passing in for its name i.e. case sensitivity etc.
1) If i put the debug arrow before this line then it doesnt run and cant see what value path is ??

2) This works

3) This works.
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 08:08 AM   #6 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

Quote:
Originally Posted by Alexj17 View Post
1) If i put the debug arrow before this line then it doesnt run and cant see what value path is ??

2) This works

3) This works.
NSString *videoName = [(MissileAppDelegate *)[[UIApplication sharedApplication] delegate] vid_name];

****Variable is not a CFString at this time.
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 08:31 AM   #7 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
NSString *videoName = [(MissileAppDelegate *)[[UIApplication sharedApplication] delegate] vid_name];

****Variable is not a CFString at this time.
OK I've had a thought. Have you imported your appdelegate into your class.

i.e. #import "MissileAppDelegate.h"
wuf810 is offline   Reply With Quote
Old 08-17-2010, 08:34 AM   #8 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

Yeah, i have many other variables that work fine. they are just defined in the delegate by var = @"yeah"

its when i use the [push object....] thing it brakes.

its got to be something do with the wrong type of variable getting passed, CFString and NSString i dont know.
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 08:37 AM   #9 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
NSString *videoName = [(MissileAppDelegate *)[[UIApplication sharedApplication] delegate] vid_name];

****Variable is not a CFString at this time.
Ok, step over this line with the debugger and then hold your mouse over videoName and from the little pop up choose to print.

Also if you can print vid_name

The values will appear in the console. If they are black there's your problem.
wuf810 is offline   Reply With Quote
Old 08-17-2010, 08:41 AM   #10 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

Printing description of videoName:
UIDeviceRGBColorSpace 0 0 0 1
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 08:44 AM   #11 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
Printing description of videoName:
UIDeviceRGBColorSpace 0 0 0 1
Then what is being returned from your appdelegate is not a string and definitely can't be used as a path to your video.

What exactly does your "Push" dictionary store.

Basically all you want to do is to store the name of the video as a NSString in vid_name and use this to generate a path in order to load the video.

You definitely need to check out what is return from the push dictionary.
wuf810 is offline   Reply With Quote
Old 08-17-2010, 08:53 AM   #12 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

vid_name = [push objectForKey:@"vid"];
test356985 = vid_name;


Printing description of test356985:
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (CFShow) will be abandoned.
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (CFShow) will be abandoned.
Alexj17 is offline   Reply With Quote
Old 08-17-2010, 09:10 AM   #13 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
vid_name = [push objectForKey:@"vid"];
test356985 = vid_name;


Printing description of test356985:
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (CFShow) will be abandoned.
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (CFShow) will be abandoned.
Tell you what...send me a PM with details of where I can get your code and I'll take a look if you like. The forum isn't the best place for debugging :-)
wuf810 is offline   Reply With Quote
Reply

Bookmarks

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: 358
5 members and 353 guests
freewind, givensur, linkmx, Newbie123, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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