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-27-2011, 10:33 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 18
Jean Jacques is on a distinguished road
Unhappy setBackgroundColor is deprecated

I have this error/warning in the VideoController.m file which relates to the line:

Quote:
[movie setBackgroundColor:[UIColor blackColor]];
The Xcode commentary says:

Quote:
setBackgroundColor is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimul...
Would be great if I could receive PLAIN instructions - for a newbie programmer lacking fundamentals - how to get rid of these errors. I of course checked other posts on similar stuff but did not manage to implement found suggestions... So what precisely should I put in this line?

Thanks a million!
Jean Jacques is offline   Reply With Quote
Old 08-27-2011, 10:58 AM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Jean Jacques View Post
I have this error/warning in the VideoController.m file which relates to the line:


Code:
[movie setBackgroundColor:[UIColor blackColor]];
The Xcode commentary says:



Would be great if I could receive PLAIN instructions - for a newbie programmer lacking fundamentals - how to get rid of these errors. I of course checked other posts on similar stuff but did not manage to implement found suggestions... So what precisely should I put in this line?

Thanks a million!
Use code tags, not quote tags, for including code. If you use quote tags, when somebody replies, the quotes are lost.

I gather that

"movie" is an MPMoviePlayerController?

Don't just look at the messages from the error window. Go look at the documentation for the class who's method is deprecated. Generally, that's where the info on what to do will be.

In this case, it says:

Quote:
backgroundColor
The color of the background area behind the movie. (Available in iOS 2.0 through iOS 3.1. Get the view from the backgroundView property and set its color directly.)
So, if you look at MPMoviePlayerController, it has a property backgroundView. The BackgroundView is a UIView, and UIVIew has a backgroundColor property.

So, your change would be:


Code:
[[movie backgroundView] setBackgroundColor:[UIColor blackColor]];
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 08-27-2011, 04:36 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 25
rcirka is on a distinguished road
Default

If you look in the iOS developer library or the headers, it will often tell you why it is deprecated and what to use instead.
__________________
www.RonaldCirka.com
Equinox |TeamLiquid
Available for freelancing opportunities
rcirka is offline   Reply With Quote
Old 08-28-2011, 06:47 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 18
Jean Jacques is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post

So, your change would be:

Code:
[[movie backgroundView] setBackgroundColor:[UIColor blackColor]];
Duncan, I owe you a beer :-) Thanks a lot, have a great day!
Jean Jacques is offline   Reply With Quote
Old 08-28-2011, 07:08 PM   #5 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Jean Jacques View Post
Duncan, I owe you a beer :-) Thanks a lot, have a great day!
LOL. That's my new iPhone Dev SDK profile tagline:

"Will answer questions for beer."
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
app, appliation, deprecated, iphone, xcode

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: 395
15 members and 380 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jonathandeknudt, kilobytedump, Matrix23, raymng, ryantcb, stanny, UMAD, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

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