Post

Replies

Boosts

Views

Activity

Reply to Viewing Interface in XCode 12.3
There is a .xib file. I recall editing the interface a few months ago but don't seem able to do it now after a few upgrades. CocoaSlideShow was from Github. I downloaded a zip of the CocoaSlideShow code from GitHub. The first time I viewed it with XCode (12.3.(12C33)) I could see the interface. After closing and re-opening I could not see it.
Mar ’21
Reply to Viewing Interface in XCode 12.3
When I click on MainMenu.xib on the downloaded code, the interface appears OK. When I click on same file in the Modified code I don't see it and the message Unable to load Revisions appears and no interface is shown. What does this signify? The modification I am trying to do is to add a pad region below the image, write some text entered in a text box in the pad region when a button is clicked. If I try and determine how to do this by setting a breakpoint where the image EXIF metadata is set, the call stack shown in the left pane contains what looks like assembler (Framework code) in the routine which calls the one in which the breakpoint is set. If I add a button, how can I make its click event execute the code to add padding to the image and write in it?
Mar ’21
Reply to Viewing Interface in XCode 12.3
MainMenu.xib is present in modified project. When I click on it I see in the left half of the centre pane some XML which I think describes the interface. In the right half is the message "No Editor". Below each half is the message "Unable to load revisions". In a pane below the two halves are a number of messages including "Failed to connect (Apply) outlet from (AppDelegate) to (NSButton): missing setter or instance variable". In the right-hand pane is the message "Not Applicable". Despite these problems the project builds and runs OK. I am re-entering the project modifications to the downloaded code and so far the interface is visible when clicking MainMenu.xib.
Mar ’21
Reply to Screen controls have inverted vertical order
The Preferences screen is one which I have modified from another project in which it shows with the expected control order. I have extracted the part of the MainMenu.xib file in which the Preferences window is defined for the modified and original files. Edited versions of both are included below (full versions exceed the size limit for posts, as they comprise about 200 lines each). Modifications include additions of several controls, movement of existing controls and change of window size. Comparison between the modified and the original Preferences window code show many differences, but a significant one may be the inclusion of point key="canvasLocation" x="-842.5" y="-822.5"/ before the closing /window tag in the modified version. Update: removing the above line seems to fix the problem! Extract from Modified Preferences Window with controls in inverted order window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="379" userLabel="Preferences" customClass="NSPanel" windowStyleMask key="styleMask" titled="YES" closable="YES"/ windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/ rect key="contentRect" x="391" y="507" width="269" height="375"/ rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/ view key="contentView" id="380" customClass="NSButton" ..... /view point key="canvasLocation" x="-842.5" y="-822.5"/ /window Original Preferences Window with controls in expected order window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="379" userLabel="Preferences" customClass="NSPanel" windowStyleMask key="styleMask" titled="YES" closable="YES"/ windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/ rect key="contentRect" x="391" y="507" width="249" height="199"/ rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/ view key="contentView" id="380" .... /view /window
Mar ’21
Reply to Screen controls have inverted vertical order
Update - problem reappeared and the fix described did not work. Canvas location describes where the window is shown in interface view. Tried removing customClass="NSButton" from view key="contentView" id="380" customClass="NSButton" via the Identity Inspector, which showed a greyed out NSView in the Custom Class area after I deleted NSButton. This resulted in the controls being shown with the correct ordering.
Mar ’21
Reply to Where is the data for standardUserDefaults stored?
The .plist file is contained in a hidden folder as Users/username/library/preferences/bundle identifier.plist. Hidden folders and files can be displayed in Finder by typing cmd [apple symbol]-shift- period[.]. The same command repeated hides them, providing Finder is not displaying items in a hidden folder. Finder search does not appear to display items in hidden folders even if hidden items are shown in the display.
Mar ’21
Reply to Error 405 when trying to upload text to create a file
Thanks Quinn. I checked the IIS server failed request log (which contains a lot of detail) and noticed that the request used anonymous authentication. It seems likely that the server would block anonymous users from anything but reading from a web page as a security measure, which is why I can read from a file in the folder but not write a new one in it. If this is the case, how do I add authentication to the request?
Apr ’21
Reply to Error 405 when trying to upload text to create a file
I have now got creation of a text file on a web server from a string working using the following code: (void) UploadFileContent: (NSString *) fileContent{         // URL for script file on server in folder where file will be created         NSString *urlString = @"https://xxxx/xxxx/Upload.aspx"         NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];         [request setURL:[NSURL URLWithString:urlString]];          [request setHTTPMethod:@"POST"];     NSString *boundary = @"---------------------------14737809831466499882746641449";          NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];         [request addValue:contentType forHTTPHeaderField: @"Content-Type"];         NSMutableData *body = [NSMutableData data];         [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; // UploadedFile.txt is name of file to be created     [body appendData:[@"Content-Disposition: form-data; name=\"userfile\"; filename=\"UploadedFile.txt\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];     [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];       [body appendData:[[NSString stringWithString:fileContent] dataUsingEncoding:NSUTF8StringEncoding]];       [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];         // set the body of the post to the request         [request setHTTPBody:body];         // connect to the web         NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];         NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; } The Upload.aspx file is %@ Import Namespace="System"% %@ Import Namespace="System.IO"% %@ Import Namespace="System.Net"% %@ Import NameSpace="System.Web"% Script language="C#" runat=server void Page_Load(object sender, EventArgs e) { foreach(string f in Request.Files.AllKeys) { HttpPostedFile file = Request.Files[f]; // FolderPath = path to folder containing file to be created eg C:\inetpub\wwwroot\***\***\***\ string sFilePath = @"FolderPath" + file.FileName; if(System.IO.File.Exists(sFilePath)) System.IO.File.Delete(sFilePath); file.SaveAs(sFilePath); } } /Script html body p Upload complete. /p /body /html
Apr ’21
Reply to Create iPhone 6 iOS 12.4 simulator on Xcode 12.3
Even though the options are greyed out, clicking on the download (down arrow) icon shows a screen "Xcode is trying to install Apple-provided software" and prompts of credentials to allow this. The simulator download then proceeds and the greyed out down arrow is eventually replaced by a blue tick, and simulators for devices using the downlooed iOS appear in options.
Jun ’22