Posts by Lucas Barbosa • 326 points
11 posts
-
3
votes1
answer200
viewsA: Bash. What’s export for?
When you set a variable using export, this variable is copied to the shell children when it does fork. Without the export, the variable is not copied to the children. When you call ./script1.sh, the…
bashanswered Lucas Barbosa 326 -
1
votes1
answer22
viewsA: Problem accessing data from an object in an object array
When you set the array produtos as a class member Loja and does not initialize this variable, its default value is null. So when you call loja.getProdutos()[0].setNome("abacaxi");, is trying to…
-
5
votes1
answer287
viewsA: Save latitude and longitude in Swift
Victor, There are a few different ways to solve your problem. It is not a Swift problem per se, but a design. It is not easy to think of the "best way" right away, the experience comes with time.…
-
2
votes1
answer90
viewsA: Nsnotificationcenter calls several times the page - Swift
The problem lies precisely in putting this code on all view controllers. All of them will receive notification when said event occurs (even if they are not the "present on screen" at the time of…
-
0
votes1
answer326
viewsA: Import a Pod function - Cocoapods Swift
Create a new project in Xcode. Close Xcode. Open the terminal and navigate to the project folder Digital pod init and gives enter. This will create a file called Podfile. Open this file in any…
-
1
votes1
answer41
viewsA: Create a structure from an xml
Apparently the Catalog is a array of Books, correct? If you already have XML as a dictionary and class Book created, one way to read the dictionary would be the following: for rawBook in…
-
1
votes2
answers419
viewsA: Swift - how do I find the screen size of the user’s device?
The translation of this code to Swift is as follows: let screenScale = UIScreen.mainScreen().scale NSLog("Escala \(screenScale)") let screenBounds = UIScreen.mainScreen().bounds NSLog("Bounds…
-
1
votes2
answers96
viewsA: How to debug errors in Realm DB?
I’ve never messed with Realmdb, but from the error message, it looks like you’re trying to access Realm from an unauthorized thread. I searched the Internet and found this here: Multi-threading with…
-
0
votes1
answer72
viewsA: Reloaddata in Tableview loading wrong image Swift 2.0
Are you using cell recycling? Both the UITableView as to the UICollectionView Sometimes, when they recycle a memory cell, they don’t update some of the right components. . Another thing that may be…
-
1
votes2
answers489
viewsA: Maximum limit of a text box - Swift
Defines the delegate of the UITextField for an object of yours and implements the method textField shouldChangeCharactersInRange. Example: class ViewController: UIViewController, UITextFieldDelegate…
-
-1
votes1
answer115
viewsA: Download file on IOS - Swift
According to the documentation, NSURLSession and NSURLSessionConfiguration work in iOS 7. Source: Nsurlsession Class Reference Nsurlsessionconfiguration Class Reference…