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 07-10-2010, 05:31 AM   #15 (permalink)
darkangelbhv
Registered Member
 
Join Date: Jul 2010
Posts: 1
darkangelbhv is on a distinguished road
Default

Before we can use the flashMode we must use lockForConfiguration.

My Code:


Code:
NSArray* devices = [AVCaptureDevice devices];
AVCaptureDevice* captDevice = nil;
NSLog(@"%d devices found", [devices count]);

for(AVCaptureDevice* device in devices)
{
	if([device hasFlash])
	{
		NSLog(@"device has flash");
		
		
		if ([device isFlashModeSupported:AVCaptureFlashModeOn]) {

			if([device lockForConfiguration:&error])
			{
				device.flashMode = AVCaptureFlashModeOn;
			}
			
		}
	}
}
}

But the flashlight is off :/ What´s wrong ?

Quote:
I have the same problem adding the AVFoundation.framework. (AVCaptureDevice is undeclared)
Test your Code on a iPhone 4. If you run this Code in Simulator it shows this error. If you use a Device it show´s no error

Last edited by darkangelbhv; 07-10-2010 at 06:31 AM.
darkangelbhv is offline   Reply With Quote
 

» Advertisements
» Online Users: 345
17 members and 328 guests
acegames, alexP, checkright, FetaBoy, Gary OBrien, heshiming, hongto24, matador1978, Newbie123, Objective Zero, Paul Slocum, PavelSea, Pudding, revg, RickSDK, simplymuzik3, stevenkik
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,552
Threads: 94,078
Posts: 402,732
Top Poster: BrianSlick (7,990)
Welcome to our newest member, veliata73
Powered by vBadvanced CMPS v3.1.0

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