Post

Replies

Boosts

Views

Activity

Reply to core data and array
You should define a struct with the var, date, title, goal, nogoal, id struct MyData { var date: Date var title: String var goal: Int var nogoal: ??? var id: ??? } Then create ab array var myData : [MyData] = [] Read the elements from core Data, load each in a new MyData value and append to the array. Please tell if you miss something.
Topic: App & System Services SubTopic: iCloud Tags:
Oct ’21
Reply to 4.3 Design Spam
You could try to ask the former developer to sign you a letter certifying that he/she has transferred you the rights on the app. I would then probably have to remove the app for the appstore to let you publish the new one, with the same name (in this case explain clearly when submitting for review).
Oct ’21
Reply to Long Press Gesture on collectionView not working
Where do you call setupLongGestureRecognizerOnCollection ? I do not see it in the code you posted. Should it be : override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. setCellView() setMonthView() func setupLongGestureRecognizerOnCollection() { let longPressedGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(gestureRecognizer:))) longPressedGesture.minimumPressDuration = 0.5 longPressedGesture.delegate = self longPressedGesture.delaysTouchesBegan = true collectionView?.addGestureRecognizer(longPressedGesture) } setupLongGestureRecognizerOnCollection() // <<-- ADDED }
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Concurrency
What is the best way to print in the order for the given implementation Best way in what sense ? code size ? speed ? code cleanliness ? Why not have the while(sure) out of func ? (void) print:(NSString*) str { NSLog(@“%@”, str); } while(true) { [self print:@“123”]; [self print:@“ABC”]; [self print:@“456”]; [self print:@“DEF”]; }
Oct ’21
Reply to It seems Xcode 13.1 RC requires the unreleased macOS 12. Will this requirement also affect the official release of Xcode 13.1?
Did you try installing Xcode 13.1 RC1 on your Big Sur Mac ? What's the result ? If I trust this site: h t t p s : / / xcodereleases.com MacOS 11.3 would be OK for Xcode 13.1 RC1. And uses MacOS SDK 12.0. Release notes say it requires 12.0, but is it for running Xcode or only executing a MacOS app from Xcode on Mac ? I note also that all 13.0 beta did require SDK 12.0, not the final release. My guess is that Xcode 13.1 will run on MacOS 11.x and will have a 11.x SDK. We shall know soon.
Oct ’21
Reply to Swift reusable cells with corrupted indexPath
Cells are not data store. You need to have a dataSource. So, in   func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { you should populate the cell with data coming from a dataSource. Add some code in WorkotuCreationCollectionTableViewCell: struct Content { var reps: Int var weight: Int }     var data : [Content] = [Content(reps: 1, weight: 0)] Add code in   func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {         cell.repsLabel.text = String(data[indexPath.row].reps)           cell.weightLabel.text = String(data[indexPath.row].weight)
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to NSImageView with corner radius and shadow
//add cgPath var to NSBezierPath extension NSBezierPath { public var cgPath: CGPath { let path = CGMutablePath() var points = [CGPoint](repeating: .zero, count: 3) for i in 0 ..< elementCount { let type = element(at: i, associatedPoints: &points) switch type { case .moveTo: path.move(to: points[0]) case .lineTo: path.addLine(to: points[0]) case .curveTo: path.addCurve(to: points[2], control1: points[0], control2: points[1]) case .closePath: path.closeSubpath() @unknown default: continue } } return path } } //View var albumImage = NSImageView() albumImage.layer?.shadowRadius = 10.0 albumImage.layer?.shadowColor = .black albumImage.layer?.shadowOffset = CGSize(width: 10, height: 10) albumImage.layer?.shadowOpacity = 1.0 albumImage.layer?.shadowPath = NSBezierPath(roundedRect: albumImage.bounds, xRadius: 28.0, yRadius: 28.0).cgPath What is supposed draw the shadow ? You create the path, but you do not draw it.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Swift, How to write [Any] to file and read back in?
You should convert everything to String and when reading convert back to Int where needed.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to core data and array
You should define a struct with the var, date, title, goal, nogoal, id struct MyData { var date: Date var title: String var goal: Int var nogoal: ??? var id: ??? } Then create ab array var myData : [MyData] = [] Read the elements from core Data, load each in a new MyData value and append to the array. Please tell if you miss something.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to 4.3 Design Spam
You could try to ask the former developer to sign you a letter certifying that he/she has transferred you the rights on the app. I would then probably have to remove the app for the appstore to let you publish the new one, with the same name (in this case explain clearly when submitting for review).
Replies
Boosts
Views
Activity
Oct ’21
Reply to Hello,
That's more a question for Apple support (link in Contact Us at the bottom of this page.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Long Press Gesture on collectionView not working
Where do you call setupLongGestureRecognizerOnCollection ? I do not see it in the code you posted. Should it be : override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. setCellView() setMonthView() func setupLongGestureRecognizerOnCollection() { let longPressedGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(gestureRecognizer:))) longPressedGesture.minimumPressDuration = 0.5 longPressedGesture.delegate = self longPressedGesture.delaysTouchesBegan = true collectionView?.addGestureRecognizer(longPressedGesture) } setupLongGestureRecognizerOnCollection() // <<-- ADDED }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Error in adding toolbar items in NStoolbar in macOS Monterey
Do you add it in storyboard or in code ?
Replies
Boosts
Views
Activity
Oct ’21
Reply to Vanishing safari address bar?!
Which iPhone ? How much RAM ? Which iOS version ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Concurrency
What is the best way to print in the order for the given implementation Best way in what sense ? code size ? speed ? code cleanliness ? Why not have the while(sure) out of func ? (void) print:(NSString*) str { NSLog(@“%@”, str); } while(true) { [self print:@“123”]; [self print:@“ABC”]; [self print:@“456”]; [self print:@“DEF”]; }
Replies
Boosts
Views
Activity
Oct ’21
Reply to It seems Xcode 13.1 RC requires the unreleased macOS 12. Will this requirement also affect the official release of Xcode 13.1?
Did you try installing Xcode 13.1 RC1 on your Big Sur Mac ? What's the result ? If I trust this site: h t t p s : / / xcodereleases.com MacOS 11.3 would be OK for Xcode 13.1 RC1. And uses MacOS SDK 12.0. Release notes say it requires 12.0, but is it for running Xcode or only executing a MacOS app from Xcode on Mac ? I note also that all 13.0 beta did require SDK 12.0, not the final release. My guess is that Xcode 13.1 will run on MacOS 11.x and will have a 11.x SDK. We shall know soon.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Swift reusable cells with corrupted indexPath
Cells are not data store. You need to have a dataSource. So, in   func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { you should populate the cell with data coming from a dataSource. Add some code in WorkotuCreationCollectionTableViewCell: struct Content { var reps: Int var weight: Int }     var data : [Content] = [Content(reps: 1, weight: 0)] Add code in   func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {         cell.repsLabel.text = String(data[indexPath.row].reps)           cell.weightLabel.text = String(data[indexPath.row].weight)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode 13(13A233)
the method of switching vertical and horizontal screen is executed.  Could you explain precisely what you do, what you get, what you expect. May be a screen capture could help understand.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x0)
Error code : Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x0) Please show complete code of the class where you use liveLabel Where does it crash exactly ? Show the complete crash log.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to NSImageView with corner radius and shadow
//add cgPath var to NSBezierPath extension NSBezierPath { public var cgPath: CGPath { let path = CGMutablePath() var points = [CGPoint](repeating: .zero, count: 3) for i in 0 ..< elementCount { let type = element(at: i, associatedPoints: &points) switch type { case .moveTo: path.move(to: points[0]) case .lineTo: path.addLine(to: points[0]) case .curveTo: path.addCurve(to: points[2], control1: points[0], control2: points[1]) case .closePath: path.closeSubpath() @unknown default: continue } } return path } } //View var albumImage = NSImageView() albumImage.layer?.shadowRadius = 10.0 albumImage.layer?.shadowColor = .black albumImage.layer?.shadowOffset = CGSize(width: 10, height: 10) albumImage.layer?.shadowOpacity = 1.0 albumImage.layer?.shadowPath = NSBezierPath(roundedRect: albumImage.bounds, xRadius: 28.0, yRadius: 28.0).cgPath What is supposed draw the shadow ? You create the path, but you do not draw it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x0)
If IBOutlet not connected, connect it. If connected, connection may be damaged: remove the connection (click on the small x in front of IBOutlet in IB) reconnect do a Clean Build Folder to be completely sure everything OK.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Compatibility between Xcode 12.3 and Xcode 12.0.1
let pan = card.pan ?? "", Could you show how you defined card ? If it is a class or a struct which has a var pan, it should be declared as: var pan: String? It could be that 12.3 is more strict on some type checking than 12.0
Replies
Boosts
Views
Activity
Oct ’21