avfoundation - Trouble with saving an NSMutableArray with url's at NSUserDefaults -


I created an app that I read and I record audio and then save all audio files permanently I try From my unique URL path in a mutablearray and from there to NSUserDefaults, but I am trying to set a non-property-list object error here is a part of my code that crashes:

  - (zero) audio recorderDefinishing recording: (avioiodic recorders *) Recorder successfully: {BOOL} flag {if (flag == true} {[self.recordings addObject: _audioRecorder.url]; NSLog (@ " % @ ", Self recording.); [User. Folose set object: recording for yourself: insect: FTS]; [self-user synchronization of default]; NSLog (@ "% @", self recording);}}  

Thank you.

- (zero) viewDidoadload {[Super Viewedload]; // NSUserDefaults for Yourself Object Receive User.Defaults = [NSUserDefaults StandardUserDefaults]; // tag of app-tag Mr. couple of NSDictionary found NSArray * dictionary = [self.userDefaults arrayForKey: FTS]; // If zero is zero, create empty NSMutableDictionary; / Otherwise, create NSMutableCopy of dictionary if (dictionary == zero) self.recordings = [[NSMutableArray alloc] init]; Other self Records = [Dictionary Miptype]; // MonaDiko Gia to Catheena NSDetformat from Nailakweem to Onoma to Arxaiyo * Format = [[NSDetformer Elok] IIT]; Formatter.dateFormat = @ "ddMMMYY_hhmmssa"; NSString * date = [[[Format string format: [date of NSDT]] stringbapping string: @ ".caf"]; _playButton.enabled = No; _stopButton.enabled = NO; NSArray * Direpath; NSString * docsDir; DirPaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, Yes); Docdir = diaper path [0]; NSString * soundFilePath = [docsDir stringBappingPath company: date]; NSURL * soundFileURL = [NSUr File URL with Path: SoundFile Path]; NSDictionary * recordSettings = [NSDiction Dictionary with Object and Cause: [NSNumber Number with Int: AVAudioQualityMin], AVEncoderAudioQualityKey, [NSNumber Numberless IT: 16], AVCoderBitRectkey, [NSNumber NumberAutumn: 2], of Avon of the Chains, [NSNumber Number Explosion: 44100.0 ], Avesplerai, nal]; NSError * Error = Zero; AVAUDIO SESSION * AUDIO SESSION = [AVIDIO SASH Shared Instance]; [AudioSession SetDigitNet: Evolutionary Carrier Play and Record Error: Zero]; _audioRecorder = [[AVAudioRecorder alloc] initWithURL: Soundfile URL Settings: Record Settings Error: & amp; Error]; _audioRecorder.delegate = self; If (error) {NSLog (@ "Error:% @", [Error localization]]; } And {[to prepare the _audio orderorder]; }}

Try your urls like NSDT

  [self Recording addObject: _audioRecorder.url]; NSMutableArray * archiveArray = [ability with NSMutableArray array: self.recordings.count]; (NSString * Self-recording in AudioPath) {NSData * pathAudioData = [NSKeyedArchiver archivedDataWithRootObject: audioPath]; [Archive add object: PathAdio Dta]; } NSUserDefaults * userDefaults = [NSUserDefaults standard user defaults]; [UserDefaults setObject: archiveArray forKey: FTP];  

Remember that you can store things like NSArray, NSDictionary, NSString, NSData, NSNumber, and NSDate NSUserDefaults Are there.

>

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -