{"id":6052,"date":"2014-04-12T02:55:13","date_gmt":"2014-04-12T02:55:13","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/objective-ciosxcodefile-uploadnsdaterelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-04-12T02:55:13","modified_gmt":"2014-04-12T02:55:13","slug":"objective-ciosxcodefile-uploadnsdaterelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/objective-ciosxcodefile-uploadnsdaterelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"objective-c,ios,xcode,file-upload,nsdateRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c521c11562c3540db79eca1cd632bd5e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrock Woolf<br \/>\nobjective-c cocoa cocoa-touch nsstring<br \/>\nI have an NSString like so:@&#8221;200hello&#8221;or @&#8221;0 something&#8221;What I would like to be able to do is take the first occuring number in the NSString and convert it into an int. So that @&#8221;200hello&#8221; would become int = 200.and @&#8221;0 something&#8221; would become int = 0.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/530d60c4e39f05f49896c2c37078411a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBartosz Ciechanowski<br \/>\nobjective-c lambda objective-c-blocks continuations structured-programming<br \/>\nWhen using methods which return blocks they can be very convenient. However, when you have to string a few of them together it gets messy really quicklyfor instance, you have to call 4 URLs in succession:[remoteAPIWithURL:url1 success:^(int status){[remoteAPIWithURL:url2 success:^(int status){[remoteAPIWithURL:url3 success:^(int status){[remoteAPIWithURL:url2 success:^(int status){\/\/succes!!!}];}];}]; }];So for every iteration I go one level deeper, and I don&#8217;t even handle errors in the nested<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4e497767d0a1523c9afbbe2722a73523?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRakhe Kara<br \/>\nios iphone objective-c cocoa-touch<br \/>\nActually this crash is not reproducing every time, even not frequently but we got this crash in our production app. I am not sure where is the problem. It is telling crash is happening in thread 4 in Environments class line number 38.Code:NSBundle* bundle = [NSBundle mainBundle];NSString* envsPListPath = [bundle pathForResource:@&#8221;Environment&#8221; ofType:@&#8221;plist&#8221;];Line 38: NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];But according to exception type:00000020<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cc54370be995ce0d68289d82ec143fe1?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nMusterknabe<br \/>\nios objective-c<br \/>\nI have the following problem. I have a Model, called User. When the user now logins with Facebook, my app checks if the user exists already in the database. To not freeze the UI (since I&#8217;m coming from Android) I thought to use NSURLConnection sendAsynchronousRequest. What worked at first was the following:My User Model had a method to do the whole task of the AsynchronousRequest and then when finished would set a variable to loading. Then other classes, could simply check with while ( !user.loa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3786e4b772ba9c3fcebdb7c53684aa52?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJosh Bradley<br \/>\nobjective-c sockets bsd-sockets<br \/>\nOk, I have a problem with building a socket using Objective-C. If you&#8217;ll take a look at my code below, through help with example code and other sources, I was able to build a complete socket I believe. The problem is that when I compile it, it builds fine (no syntax problems), but there are no sockets being created. As you&#8217;ll notice I&#8217;ve commented out a lot of things in Server2.m and have isolated the problem to the very beginning when I create the struct for the listeningSocket. By the way, if<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/49756adee7cc8a8a3b80c85639ff3d82?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTodd Ditchendorf<br \/>\nobjective-c xcode frameworks compiler-errors parsekit<br \/>\nI am trying to add the Parsekit framework to my OSX Xcode project. I&#8217;ve never added a 3rd party framework before and I can&#8217;t get it to work right.I dragged the included Xcode project into my &#8216;Groups &amp; Files&#8217; pane and chose to Add it to my project. I then dragged Parsekit.framework underneath the Link Binary With Libraries heading. Then I double-clicked my target app and added Parsekit as a Direct Dependency. I also added libicucore.dylib as a Linked Library (as it says to do this on their si<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c66f5ead165235158b86a421c1adb00d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nzioolek<br \/>\nobjective-c cocoa nsimage pgm<br \/>\nHi everyone! It is my first post here.I am quite new in objective-c so maybe my question is not so hard but It is a problem for me. I&#8217;ve searched the web and didn&#8217;t find any useful hints for me&#8230; I am writing a program in Objective-c in Xcode. I need to read and display a pgm file (P5 with two bytes per pixel). To do that i&#8217;m trying to subclass NSImageRep but I don&#8217;t know how to create a proper bitmap for this file and how to draw it. Below is my code so far:header:@interface CTPWTPGMImageRep :<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4926053f9238c44da0ea8dc27ce113ba?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nOliver<br \/>\niphone objective-c uiscrollview<br \/>\nHow can I force a UIScrollView in which paging and scrolling are on to only move vertically or horizontally at a given moment?My understanding is that the directionalLockEnabled property should achieve this, but a diagonal swipe still causes the view to scroll diagonally instead of restricting motion to a single axis.Edit: to be clearer, I&#8217;d like to allow the user to scroll horizontally OR vertically, but not both simultaneously.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dc26c949cc5a1d13a346dc231f4f1159?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nElwisz<br \/>\nobjective-c osx cocoa nsdocument autosave<br \/>\nI have a NSDocument based OS X app which instead of creating new documents with a blank page shows a panel to the user to chose a template from, like for example Apple&#8217;s Pages.app does.I made this by manually creating a new NSDocument instance when the user starts a new document and immediately setting a property on it to reflect which template the user has chosen for it:MyNSDocumentSubclass *newDoc = [sharedDocumentController makeUntitledDocumentOfType:fileType error:&amp;err]; [newDoc setTempl<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/536bcab5572944d66f04d12670638e08?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKanwar Singh<br \/>\niphone objective-c json ios6 afnetworking<br \/>\nI have webservice in java. and i am posting JSON by AFnetworking but its not working when i user below codeNSURL *url = [NSURL URLWithString:@&#8221;http:\/\/localhost8080\/webservice\/usersprofile\/&#8221;]; AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url]; \/\/ don&#8217;t forget to set parameterEncoding! httpClient.parameterEncoding = AFJSONParameterEncoding;NSDictionary *params = @{@&#8221;id&#8221;:@&#8221;12&#8243;,@&#8221;firstName&#8221; : @&#8221;Tested&#8221;, @&#8221;lastName&#8221;:@&#8221;User&#8221;,@&#8221;email&#8221;:@&#8221;TEsted@gmail.com&#8221;,@&#8221;age&#8221;:@&#8221;25&#8243;,@&#8221;addLine1&#8243;:@&#8221;T<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cb791c8f12e687d3538677321cdc8d2a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDaniel<br \/>\nios memory-management xcode5<br \/>\nI am new to Objective C so this code is probably not written that well. When the app is launched, it calls the following code if it has not been saved into the phone yet. When it starts to loop through the while loop, the app crashes on any phone the is not the iphone 5s. I think this is due to the memory usage. I believe that inside the while loop, when the NSMutableString (movieTitle) is created, is where the memory spike is. I should also add that the amount of times the loop is iterated is a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3158acca2b83111622b590c4b8f3cd2d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2541100<br \/>\nios audiounit<br \/>\nI am playing sound file(.caf) that play and make sine waves like audiounit and augraph works. It is playing fine and showing sine waves perfectly in simulator. But when i run it on iPad it is not working(no sound and no waves).I have tried many things but nothing works. But i do analyse one thing that when i run it on simulator Bool value is Stereo is Yes.But when it runs on iPad is Stereo becomes NO and number of channels becomes 1 from 2.Any help would be appreciated.My code is -static OSStatu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0263c4c9036955a2d9768bf6a35a8345?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKara<br \/>\nios xcode core-data memory<br \/>\nWith my App I have a pre-populated sqlite DB that I created using core data from another app I created so the Data model is the same. I copy it over and everything works great. I tried it on every iOS device that can run iOS 6.0 because that is what I am building for. Even on the early iPod Touches the App works. It takes around 45 secs for the DB to copy over on the older devices. The app works all the data is there and all devices the tests were great and no issues. I released the app on<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/943fe748f9902ced31e983c13f356e64?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRicardo Cerqueira<br \/>\nios xcode crash cocos2d adhoc<br \/>\nmy app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can&#8217;t understand what could be wrong, any tips on how to test it better?Apple rejected it with this message:We found that your app failed to launch on an iPhone 5 and iPad 3rd gen running iOS 6.1.3, on both Wi-Fi and cellular networks.We encountered the issue when selecting the application on the Home screen &#8211; the app displayed a launch image then quit unexpectedly. This may be b<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/99BBZ.jpg?s=32&amp;g=1\" \/><br \/>\nzakishaheen<br \/>\nios crash google-analytics crash-reports<br \/>\nI get the following crash (0x8badf00d) because of something to do with Google Analytics SDK 1.1. What&#8217;s also strange is that iOS killed it in just 1 second?I initialize the tracker like this:[[GANTracker sharedTracker] startTrackerWithAccountID:kGANWebPropertyID dispatchPeriod:kGANDispatchPeriodSec delegate:self];Here is the crash logIncident Identifier: 5459E916-5306-408A-A630-F405DFD97711 CrashReporter Key: 20ac546c31144c5f86de428ce3332012ab604d49 Hardware Model: iPhone3,1 Process:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a44892290364a20f0c29f5c27d419009?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nraulCab<br \/>\nios<br \/>\nI am building an app that send data when the user enters in the background. It also uses geofencing. When the user enters or exits a geofence I call an API. Sometimes when I open the app from the background it just shows a black screen and it is completely frozen. I have to kill it and start it again.I think the issue is when I call the API when the user enters the background. In the applicationDidEnterBackground I am calling a method call createJSON:NSData *jsonData = [NSJSONSerialization data<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4e497767d0a1523c9afbbe2722a73523?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRakhe Kara<br \/>\nios iphone objective-c cocoa-touch<br \/>\nActually this crash is not reproducing every time, even not frequently but we got this crash in our production app. I am not sure where is the problem. It is telling crash is happening in thread 4 in Environments class line number 38.Code:NSBundle* bundle = [NSBundle mainBundle];NSString* envsPListPath = [bundle pathForResource:@&#8221;Environment&#8221; ofType:@&#8221;plist&#8221;];Line 38: NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];But according to exception type:00000020<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6f5e4631aece4ed851f4f4e621886072?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSean Freitag<br \/>\nios xcode xctest<br \/>\nWhen running integration tests w\/ live requests against a server, sometimes I get the following crash. Does anyone have an idea why?I&#8217;m currently on OS X Mavericks and running these tests on the iOS 7.0.3 SDK and Jenkins.2014-01-23 14:55:47.178 xctest[74229:303] 200 &lt;- https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:55:47.186 xctest[74229:303] GET -&gt; https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:5<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cc54370be995ce0d68289d82ec143fe1?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nMusterknabe<br \/>\nios objective-c<br \/>\nI have the following problem. I have a Model, called User. When the user now logins with Facebook, my app checks if the user exists already in the database. To not freeze the UI (since I&#8217;m coming from Android) I thought to use NSURLConnection sendAsynchronousRequest. What worked at first was the following:My User Model had a method to do the whole task of the AsynchronousRequest and then when finished would set a variable to loading. Then other classes, could simply check with while ( !user.loa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6c4422458e08fd9aeb96bcc4001bb8e3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen L.<br \/>\nios core-data crash game-center gamekit<br \/>\nI have an iOS app that consistently crashes when you try to delete a GKTurnBasedMatch using [match removeWithCompletionHandler:^(NSError *error){}];When the completion handler is called, error is nil, meaning that it successfully deleted the match. The match does get deleted (it never re-appears), but at the same time, gamed (the background daemon written by apple that communicates with GameCenter servers) crashes. Here is what I see in the Console when I delete a game:Jan 19 20:47:22 Ben-L-iPho<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/JOwPH.jpg?s=32&amp;g=1\" \/><br \/>\nDragos Rizescu<br \/>\nxcode osx crash lldb<br \/>\nI&#8217;ve only started using Xcode from this morning, although I have it for a while now. Anyway, for working mostly on C projects I used Netbeans&#8230;To make a long story short, I noticed this morning, right after creating my first project, an OS X C Command Line Application, that when running (CMD + R) my project, Xcode crashes right after building it. It crashes exactly when it&#8217;s running the project. It doesn&#8217;t give any error message, the program just quits. As I am new to Xcode, I have no idea wher<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/BAYnK.jpg?s=32&amp;g=1\" \/><br \/>\nShekhar Gupta<br \/>\niphone xcode terminal<br \/>\nIs there some way by which I can use Xcode only to organise my code and not display errors at the time of compilation? I want that the error messages and the output get displayed in the Terminal instead. I am a college student and am learning how to program in C. I really want the error messages to be displayed in the Terminal, as they are shown there in a fairly cryptic manner, instead of the user friendly manner which is there is in Xcode.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/GDJog.jpg?s=32&amp;g=1\" \/><br \/>\nAnna Kuznetsova<br \/>\nxcode clang osx-mountain-lion configure<br \/>\non MacOSX 10.8.5, after upgrading to Xcode 5.0.2 (and upgrading\/installing the Command Line Tools (from within Xcode preferences) I was installing FFTW 3.3.3 and Open MPI 1.6.5 by configuring them from the sources. I get the same type of error in both config.log files in the configure step, which shows the problem is not with the programs as I downloaded them from the official websites. In short, the first error I see in the both logs is:configure:3750: checking for gcc configure:3766: found \/us<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0263c4c9036955a2d9768bf6a35a8345?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKara<br \/>\nios xcode core-data memory<br \/>\nWith my App I have a pre-populated sqlite DB that I created using core data from another app I created so the Data model is the same. I copy it over and everything works great. I tried it on every iOS device that can run iOS 6.0 because that is what I am building for. Even on the early iPod Touches the App works. It takes around 45 secs for the DB to copy over on the older devices. The app works all the data is there and all devices the tests were great and no issues. I released the app on<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/943fe748f9902ced31e983c13f356e64?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRicardo Cerqueira<br \/>\nios xcode crash cocos2d adhoc<br \/>\nmy app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can&#8217;t understand what could be wrong, any tips on how to test it better?Apple rejected it with this message:We found that your app failed to launch on an iPhone 5 and iPad 3rd gen running iOS 6.1.3, on both Wi-Fi and cellular networks.We encountered the issue when selecting the application on the Home screen &#8211; the app displayed a launch image then quit unexpectedly. This may be b<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d787ff4bf7bbe53bfe9baaa2721c8155?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser3443321<br \/>\nruby xcode osx github<br \/>\nUsing OS X 10.9.2 MavericksI have troubles installing the github-pages gem. I need to install Xcode first, but that results in an error. I tried to install Xcode using the command: xcode-select &#8211;install. The dialog box displays three options: Download Xcode, Not now, Install When I select &#8216;Install&#8217; and after select accept, the process begins and stops after a while. Displaying that the software is not available on the update server. When I select &#8216;Download Xcod&#8217;e, App store launches and I can i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4f24140ad61b33d19c9869bc2e67bae0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2024621<br \/>\nruby xcode gem llvm-gcc<br \/>\nMy development stack has been completely turned upside down since I&#8217;ve done the Apple last update of March 11, 2014, and I try to fix it bit by bit. Right now I&#8217;m stuck with the following error when I try to install the gem glib2:$ gem install glib2Building native extensions. This could take a while&#8230;ERROR: Error installing glib2:ERROR: Failed to build gem native extension.\/Users\/ymesserl\/.rvm\/rubies\/ruby-2.0.0-p451\/bin\/ruby extconf.rbchecking for -Wall option to compiler&#8230; yeschecking for &#8211;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6f5e4631aece4ed851f4f4e621886072?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSean Freitag<br \/>\nios xcode xctest<br \/>\nWhen running integration tests w\/ live requests against a server, sometimes I get the following crash. Does anyone have an idea why?I&#8217;m currently on OS X Mavericks and running these tests on the iOS 7.0.3 SDK and Jenkins.2014-01-23 14:55:47.178 xctest[74229:303] 200 &lt;- https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:55:47.186 xctest[74229:303] GET -&gt; https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:5<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/49756adee7cc8a8a3b80c85639ff3d82?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTodd Ditchendorf<br \/>\nobjective-c xcode frameworks compiler-errors parsekit<br \/>\nI am trying to add the Parsekit framework to my OSX Xcode project. I&#8217;ve never added a 3rd party framework before and I can&#8217;t get it to work right.I dragged the included Xcode project into my &#8216;Groups &amp; Files&#8217; pane and chose to Add it to my project. I then dragged Parsekit.framework underneath the Link Binary With Libraries heading. Then I double-clicked my target app and added Parsekit as a Direct Dependency. I also added libicucore.dylib as a Linked Library (as it says to do this on their si<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e75720c12dd62a6d6fe3e82f4577c3c0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nemkman<br \/>\nruby xcode gcc osx-snow-leopard couchbase<br \/>\nMy goal is to install the couchbase ruby gem by building the native extensions, but I am having what seems like an architecture mismatch between the gem and the libcouchbase C library. Here is some background:I am running OS X 10.6.8, using rvm, and ruby 1.9.2-p320 built from source I was running OS X 10.6.7 and Xcode 3.2.5 up until yesterday but I was unable to build libcouchbase natively I then installed brew which is known to help ease the libcouchbase install, and brew told me I needed to up<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/13de5ad72b8b2b9afc3ccd9adca7d57d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArturas M<br \/>\njava servlets file-upload upload webpage<br \/>\nwell I&#8217;m trying to upload a file to my servlet from the web interface. I&#8217;ve been using Apache Commons FileUpload by following a tutorial and integrating it into my servlet. Somehow I can&#8217;t manage to get the file uploaded.Here&#8217;s my form in the web page:&lt;form class=&#8221;well&#8221; action=&#8221;GenTreeUploader&#8221; method=&#8221;post&#8221; enctype=&#8221;multipart\/form-data&#8221;&gt;&lt;label&gt;Choose your file:&lt;\/label&gt;&lt;center&gt;&lt;input type=&#8221;file&#8221; class=&#8221;input-xlarge&#8221; name=&#8221;wordfile&#8221;&gt;&lt;\/center&gt;&lt;br&gt;&lt;cente<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6305cbb1c738e615feb48584d705d64a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTapas Bose<br \/>\njava jsf file-upload jsf-1.2 swfupload<br \/>\nI have seen that we can upload multiple files by flash file upload. Like SWFUpload or YUI Uploader. Is it possible to integrate these upload component with JSF?What I want is to choose multiple file at once. Primefaces file uploader has this feature, but that don&#8217;t work in IE7 as IE7 don&#8217;t have any support for HTML5. I need to create a Form with various fields, like dropdown menu, text input etc and also need to add a file uploader for choosing multiple file. When the JSF submit button will be c<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0f9086e66e94bc6dd357806a2f4f9464?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChristophe_Dumonet<br \/>\nspring file-upload multipart<br \/>\nI got a form belonging to a web app that contains a &#8220;file&#8221; field to upload a pdf file.( spring 3 environment, multipart file upload) Uploading file works fine in test environnement (all browsers), and only works with Firefox in production environment (file upload cause connection reset exception with low internet connection client browser especially) The following exception is thrown a few seconds after submit button is pressed : ( browser is IE\/Chrome running in windows environment but not Fire<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/932ca2873d57920694708f66a514f648?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmF4d<br \/>\nphp codeigniter file-upload<br \/>\nfor the past hour I&#8217;ve been cracking up to solve this problem. I&#8217;m quite new to Codeigniter.I made a page that will upload certain file types. It works fine in my local development but not in production. It won&#8217;t pass the do_upload() function. Nothing is displayed beyond that.$path = &#8216;uploads&#8217;; echo &#8216;path: &#8216;. $path .&#8217; &lt;br&gt;&#8217;; \/\/&#8211; config for uplaod &#8212; $configUpdload[&#8216;upload_path&#8217;] = $path ; $configUpdload[&#8216;allowed_types&#8217;] = &#8216;gif|jpg|png|xls|xlsx|pdf&#8217;; $configUpdload[&#8216;max_size&#8217;] = &#8216;4000&#8217;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6e62a243d28ae2b58fcdc2d5cc5bb397?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2626445<br \/>\njava php android file-upload<br \/>\nI am calling uploadFile on item clicked.gridView.setOnItemClickListener(new OnItemClickListener() {@Overridepublic void onItemClick(AdapterView&lt;?&gt; parent, View v,int position, long id) {ImageItem item = (ImageItem) parent.getAdapter().getItem(position);Toast.makeText(MainActivity.this,item.getAddress(),Toast.LENGTH_LONG).show();uploadFile(item.getAddress());}});Here is the method UploadFile which does uploadingpublic void uploadFile(String sourceFileUri) {String fileName = sourceFileUri;Pr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/TIl12.jpg?s=32&amp;g=1\" \/><br \/>\nInnocentKiller<br \/>\nandroid video file-upload<br \/>\nI am trying to upload video file to server when recording of video get finished. I am setting video.mp4 as default file name of video while starting recording and storing inside SD-card. After recording get finished on button click event i am renaming video name and trying to upload it to my server. But unfortunately i am getting error. My app is not stopping unfortunately or anything but when i check on server video file is not getting updated, in logcat i got below error.01-29 12:52:41.116: E\/<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/TIl12.jpg?s=32&amp;g=1\" \/><br \/>\nInnocentKiller<br \/>\njava php android audio file-upload<br \/>\nI am trying to upload audio file to server when recording of audio get finished. I am setting audio.mp3 as default file name of audio while starting recording and storing inside SD-card. After recording get finished on button click event i am renaming audio name and trying to upload it to my server.But unfortunately i am getting error. My app is stopping unfortunately, in logcat i got below error. 01-30 15:08:58.452: E\/Debug(1686): error: \/storage\/sdcard\/filetoupload\/1391074738276.mp3: open fail<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2c087416ff26fb680ef4c5328f95b89f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nvjy<br \/>\njava spring file-upload<br \/>\nI have a Spring application where user uploads big files (more than 300 mb). In local, it&#8217;s working perfectly fine. However, when I try to use my application in Live, most of the time it fails (some times it gets succeed though). Here is the log from console. Can anyone help me to how to get rid of the error. I am using JQuery Chunk file upload functionality. Server is Tomcat 6.17:02:28,395 DEBUG SessionFactoryUtils:793 &#8211; Closing Hibernate Session File Path:\/home\/borneind\/ty\/uploads\/7397758850\/2<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bbad4113bb7340273c69dcec704d3baa?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nTiny dragons tail<br \/>\nandroid file-upload multipart retrofit<br \/>\nIn my project, I&#8217;ve got to send an image taken from android device to server site, where it should be stored on disk. Unfortunatelly, when I call the method on the device site I meet this error::26:26.995: DEBUG\/Retrofit(4429): java.lang.RuntimeException: Unable to write multipart request.at retrofit.mime.MultipartTypedOutput.buildPart(MultipartTypedOutput.java:86)at retrofit.mime.MultipartTypedOutput.addPart(MultipartTypedOutput.java:49)at retrofit.RequestBuilder.setArguments(RequestBuilder.j<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cfc14b1a5eac8c8bad8ca69b96165fdd?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsandeep<br \/>\nandroid audio file-upload audio-recording android-mediarecorder<br \/>\nI am trying to upload audio file to server when recording get finished. I have set CurrentDate and Time as audio file name as you can see that in below code.private String getFilename() {String filepath = Environment.getExternalStorageDirectory().getPath();File file = new File(filepath, AUDIO_RECORDER_FOLDER);SimpleDateFormat sdfDate = new SimpleDateFormat(&#8220;dd-MMM-yyyy hh-mm-ss&#8221;);String currentDateandTime = sdfDate.format(new Date());if (!file.exists()) {file.mkdirs();}return (file.getAbsolutePa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/485951dd9528d09e9fa83dd9ec7fccc0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRuben Roy<br \/>\nobjective-c nsdate nscalendar nsdatecomponents<br \/>\nI am trying to get the start and end dates of the current month. There are a few similar questions here, but I am getting unexpected results while using them. Here&#8217;s what I did:NSDate *monthStart,*monthEnd; NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = [cal components:NSDayCalendarUnit fromDate:[NSDate date]]; [comps setDay:1]; [comps setHour:0]; [comps setMinute:0]; [comps setSecond:0]; monthStart = [cal dateFromCom<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/970e963a5578ee33236e40e9633f86dc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMike Weller<br \/>\nios nsstring nsdate nsdateformatter<br \/>\nI am using the following code to convert an NSString to an NSDate:+(NSDate *)dateOfDateTimeString:(NSString *)string {NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease];[dateFormatter setDateFormat:@&#8221;yyyy.MM.dd_HH:mm aa&#8221;];[dateFormatter setTimeZone:[NSTimeZone systemTimeZone]];NSDate *date = [dateFormatter dateFromString:string];NSLog(@&#8221;try to convert string: %@ to date: %@&#8221;, string, date);return date; }However I am getting unexpected results:2012-06-14 22:26:59.208 Mo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2f90e858672c079741471f72cba5480c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen<br \/>\nios objective-c cocoa-touch nsdate nsdateformatter<br \/>\nIn short words I plan to get current dateTime, change the time and make it local to Malaysia Time by applying +0800 to timezone.The result is unexpected :-(NSDate *)departureDateTime {NSDate *date = [NSDate date];NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];NSDateComponents *components = [gregorian components: NSUIntegerMax fromDate: date];[components setHour: 7];[components setMinute: 59];[components setSecond: 17];NSDate *newDate = [gregorian dat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7ba03426a2aed94fc0185a8e5a96981f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrickharrison<br \/>\niphone nsdate nsdateformatter<br \/>\nI am trying to do some basic operations with Dates on the iPhone. I want to take a string like &#8220;2010-02-19&#8221; and turn it into a string like &#8220;Friday, Feb 19.&#8221; The strings I will be receiving will always be in 2010-02-19. Right now, I am running the following code that works, but it produces a warning that says &#8220;NSDate may not respond to +dateWithNaturalLanguageString:&#8221;NSDate *date = [NSDate dateWithNaturalLanguageString:scheduled]; NSDateFormatter *df = [[[NSDateFormatter alloc] init] autorelea<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/81d2c0d1e169fccb63893706ef70db19?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrmaddy<br \/>\nios objective-c nsdate<br \/>\nI&#8217;m new to ios programming.I&#8217;m trying to get the date of death by the code below. But, I get the unexpected result.In the example code below, someone&#8217;s birthdate is 1899-12-31 and this person&#8217;s death age is 80.So, I&#8217;m expecting this person&#8217;s deathdate is 1979-12-31. But, the result I get is 1843-11-05 08:31:44 +0000.Could anyone please tell me what&#8217;s wrong with this code?Thanks!!NSInteger year = [_selectedDeathAge intValue]; NSLog(@&#8221;%d&#8221;, year); \/\/80NSLog(@&#8221;%@&#8221;, _selectedBirthDate);\/\/(NSDate)1899<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dc91a8e29fedbd6a6d7e03a8394009ab?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNathan Hughes<br \/>\nobjective-c nsdate nscalendar nsdatecomponents<br \/>\nhow do I set an existing NSDate&#8217;s time?That is I have a date (say current date\/time), but then want to set this to a specific time (e.g. 11.23am) say. What is the quickest way to do this in objective C?I&#8217;m looking at NSCalendar and see methods such as dateByAddingComponents:toDate:options:, and dateFromComponents:, but these don&#8217;t seem to quite hit the mark for what I need here. For example:dateFromComponents: &#8211; I would have to work out all components for this to work which seems like overkill<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a895c4cc312d25a217ede5251e92ee1f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmhbdr<br \/>\nobjective-c nsdate nscalendar nsdatecomponents nstimezone<br \/>\nI&#8217;ve been using NSCalendar and NSDateComponents to return the difference (in days) between 2 dates. Here&#8217;s the code I&#8217;m using to get that.NSCalendar *calendar = [NSCalendar currentCalendar]; calendar.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];NSDate *todayDate = [NSDate date]; NSDateComponents *comps = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:todayDate]; [comps setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];NSDate *today = [cale<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9897dc5266176260997e71942f152826?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nNewbee<br \/>\nios objective-c nsdate dst nsdatecomponents<br \/>\nAs per our application specification, we need to schedule call for conference, while I scheduling I have been facing problem with Day light time difference. This is the case: US day light time changes on Nov 3 this year, when I schedule a call for eg: 5 P.M on Nov 4, that time I am converting into GMT and send to server. If I convert that GMT time its giving 4 P.M Nov 4, instead of 5 P.M. Even though its correct only, however as per user perspective he scheduled for 5 P.M not 4 P.M, so how to ha<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fb04d30b68c2b27e29fa1c3b5b55d3b2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmmvie<br \/>\nios nsdate nsdateformatter nscalendar nstimeinterval<br \/>\nI have the method below to format a duration (in seconds) to a string of the format @&#8221;mm:ss&#8221;. Whenever the particular value of 60 is entered, this method behaves unexpected:duration = 59 -&gt; @&#8221;00:59&#8243; duration = 60 -&gt; @&#8221;59:59&#8243; (expected @&#8221;01:00&#8243;) duration = 61 -&gt; @&#8221;01:01&#8243;The method:+ (NSString *)formatDuration:(NSTimeInterval)duration { NSDateFormatter *durationFormatter = [[NSDateFormatter alloc] init];[durationFormatter setDateFormat:@&#8221;mm:ss&#8221;];NSCalendar *calendar = [NSCalendar currentCalenda<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/hfmLM.jpg?s=32&amp;g=1\" \/><br \/>\niDev<br \/>\niphone objective-c ios nsdate<br \/>\nNSDate *date = [NSDate date]; NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init]; [dateFormat setDateFormat:@&#8221;MM\/dd\/yyyy&#8221;]; NSLog([@&#8221;today is &#8221; stringByAppendingString:[dateFormat stringFromDate:date]]); NSLog([@&#8221;firstBirthdayDate is &#8221; stringByAppendingString:[dateFormat stringFromDate:firstBirthdayDate]]); NSLog([@&#8221;secondBirthdayDate is &#8221; stringByAppendingString:[dateFormat stringFromDate:secondBirthdayDate]]); if ([firstBirthdayDate isEqualToDate:secondBirthdayDate])NSLog(@&#8221;First date<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Brock Woolf objective-c cocoa cocoa-touch nsstring I have an NSString like so:@&#8221;200hello&#8221;or @&#8221;0 something&#8221;What I would like to be able to do is take the first occuring number in the NSString and convert it into an int. So that @&#8221;200hello&#8221; would become int = 200.and @&#8221;0 something&#8221; would become int = 0. Bartosz Ciechanowski objective-c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6052","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6052"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6052\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}