On the iphone there are two modes of playing the external voice: handset mode and microphone mode, the handset is of course the use of the phone, the voice of course is very small,However, in the open, iOS default is this mode, so when the play outside should be added code to reset, as follows: Avaudioplayer * audioPlayer1 = [[Avaudioplayer alloc] Initwithcontentsofurl:soundurl Error:nil];Audioplayer1.volume = 1.0;[AudioPlayer1 Preparetoplay];UInt32 A
[[Uidevice currentdevice] setproximitymonitoringenabled: Yes]; // we recommend that you set yes before playing and no after playing. This function enables infrared sensing.
// Add a listener[[Nsicationcenter center defacenter center] addobserver: SelfSelector: @ selector (sensorstatechange :)Name: @ "uideviceproximitystatedidchangenotification"Object: Nil];
// Process listener-triggered events-(Void) sensorstatechange :( nsicationicationcenter *)
1, Reason:No channel is set;Avaudiosession is a singleton that can be used directly without instantiation. Avaudiosession plays a very important role in various audio environments.For different audio scenarios, you need to set different audio answering classes2, Workaround:Before initializing the Avaudioplayer, set the channel with the following code:Avaudiosession *audiosession = [avaudiosession sharedinstance]; [Audiosession setcategory:avaudiosessioncategoryplayback Error:nil];
Date and Time selector ios source code, selector ios source code
The source code is a date and time selector. The source code is DVDatePickerTableViewCell, and DVDatePickerTableViewCell is a cell written in Swift. You can provide a date and time
p = ChineseCalendarDB: GetEraAndYearOfLunar ([self. year intValue]);
To be moved
// Set the lunar Date Field of the current time
Self. year = [NSString stringWithFormat: @ "% d", chineseDate. GetYear ()];
.
This control is not a re-Implementation of the UIPickerView texture that comes with iOS. My achievements over a week have taken a lot of detours. Ha!
Reasons for developing this control:
Recently, I had a requirement to create a date w
understanding and application of @selector in iOS development
What is the @selector:
1, a type of SEL2, on behalf of the message you want to send (method), and a bit like the string, you can turn.: nsselectorfromstring ()/nsselectorfromstring ()
3, something that can be understood as a function pointer--is the thing that allows objective-c to invoke methods d
After upgrading the Cordova to 3.6.3, the following problems have arisen in the use of variantsThe error:/volumes/local.uhmuhm.net/projectxxx/htdocs/phonegap/src/projectxxx/platforms/ios/projectxxx/classes/ Mainviewcontroller.m:154:19:error:no visible @interface for ' Cdvcommanddelegateimpl ' declares the selector ' execute: ' r Eturn [Super Execute:command];Additional information is as follows:Install plat
In the latest IOS project, the selector is used in several places. For example, the commonly used regional selector (province, city, and district) has implemented a custom Dialog on the android platform. However, I am not very familiar with IOS. I downloaded some examples from the Internet, mostly using PickerView, and
(Oklala)), method_gettypeencoding (Class_ Getinstancemethod ([selfclass], @selector (Oklala))); returnYES;}return[super Resolveinstancemethod:sel];} - (void) Oklala{nbsP;nslog (@ "Oklala");} 2. Complete message forwarding: see if there are any other objects to deal with, there is a turn out, no words encapsulated into Nsinvocation object handling1) If it can be transferred to another object for processing: -(ID) Forwardingtargetforselector: (SEL) As
IOS-custom keyboard Selector
Target style:
Directly run the Code:Compliance Agreement
Implementation Method
// Create UITextField and set setInputAccessoryView to custom Toolbar and change the keyboard style to the keyboard selector-(void) creatTextField {UITextField * textField = [[UITextField alloc] initWithFrame: CGRectMake (10, 64, [UIScreen mainScreen].
Ios custom selector ActionSheetPicker available version, iospicker
The biggest problem with UIDataPicker and UIDatePicker in ios is that there are no buttons for confirmation and cancellation, while ActionSheetPicker is an open-source encapsulation of the preceding two selectors. However, there is also a small problem with this stuff, that is, there is no Chinese
The biggest problem with iOS comes with Uidatapicker and Uidatepicker is that they don't have both the OK and Cancel buttons, and Actionsheetpicker is the open source package for the above two selectors. But this east also has some small problem, is the content that does not have the Chinese to choose the device.The original Actionsheetpicker run like this:After the improvement, this looks like this.Click here to download, there is a problem can be de
IOS development-custom city selector (province + city + district/county) (storyboard version) and iosstoryboard
Step 1: create a single project CitySelectedDemo
Step 2: import the resource area. plist (check the copy option and add the area. plist file resource)
Step 3: Design mian. storyboard
-- Drag the UITextField control (click this input box to display the selector
Like what:Nsmutabledictionary *dic = [[Numutabledictionary alloc]init];[dic setvalue:@ "haha" forkey:@ "test"][Nstimer scheduledtimerwithtimeintervatal:2.0 target:self selector:@selecrtor (onTimer:) userinfo:dic Repeats:no];On the above call OnTimer: How to pass arguments, there may be a question here, I only know the method name, how do I know what type of argument to pass. In fact, it is very simple to pass the parameters of the Nstimer object, from
IOS program error: reason: [NSArrayI addObject:]: unrecognized selector sent to instance, nsarrayiaddobject
* ** Terminating app due to uncaught exception 'nsinvalidargumentexception ', reason:'-[_ NSArrayI addObject:]: unrecognized selector sent to instance 0x4b17be0'
Error:NSArray is not availableAddObject: method. It may be in the process of running the
For ios, the question about passing parameters in the selector event seems simple but confusing (resolved). iosselector
Recently, when using selector,
Add a click event to UIButton. You can add ":" After selector to pass the button as a parameter to the method,
Use today
[NSTimerscheduledTimerWithTimeInterval: 1 target
-(void) viewdidload { [super viewdidload]; Do any additional setup after loading the view, typically from a nib.} -(void) didreceivememorywarning { [super didreceivememorywarning]; Dispose of any resources the can be recreated.} -(Ibaction) onclick: (ID) Sender { NSDate *thedate = self.dataPicker.date; The Descriptionwithlocale method returns the local time //Currentlocale returns the current consumer information NSLog (@ "The date picked is:%@", [thedate Descriptionw
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.