Posts

Showing posts with the label ios

SIGSEGV(Bad Memory Access) error while profiling in Instruments

SIGSEGV(Bad Memory Access) error while profiling in Instruments I'm trying to catch memory leak and retain cycles with Leak Profiler in Instruments tool. However, whenever I click the record button in Instruments, app looks like to start then crash. If I open the app from Xcode and transfer it to Instruments, App crash after I click any of the UIButton . If I open app from Simulator, I can get the second screen but then It also crashes. In addition, App doesn't show any leak in memory graph and also doesn't crash on normal usage. UIButton Here is the crash log; Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000018 VM Region Info: 0x18 is not in any region. Bytes before following region: 4377985000 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 0000000104f2c000-0000000104fbc000 [ 576K] ...

Alamofire Multipart is not working in XCode 9.4.1

Alamofire Multipart is not working in XCode 9.4.1 When I've upgrade my XCode version to 9.4.1 , Alamofire Multipart is not working and I don't know why. It was completely working in previous XCode version. 9.4.1 Please let me know how to fix it. Thanks Alamofire.upload( multipartFormData: { multipartFormData in multipartFormData.append(self.imageFrontData, withName: "front-photo", fileName: "front-photo.png", mimeType: "image/png") multipartFormData.append(self.imageBackData, withName: "back-photo", fileName: "back-photo.png", mimeType: "image/png") for (key, value) in parameters { multipartFormData.append((value?.data(using: String.Encoding.utf8)!)!, withName: key) } }, usingThreshold: UInt64.init(), to: uploadURL!, method: .post, headers: headers) { (result) in switch result { case .success(let upload, _, _): upload.responseJSON { response in ...

Stripe ios what is the different between paymentContext and paymentMethodViewController

Stripe ios what is the different between paymentContext and paymentMethodViewController I am not working on an iOS app that uses stripe. I want to simply create a view controller that can collects user card information and saved to users customer id which I created when they register account for my app. But I want to know should I use paymentMethodViewController or STPPaymentContext to create the standard UI made by Stripe. On Stripe website, they have a demo iOS app called RocketRide, I downloaded the app and read through each line. This app only uses STPPaymentContext but it has all the UI including selectPaymentMethod and add the card. So can anyone tell me which one should I use and how to use them specifically, thank you! You can see RocketRide's UI at the top of this link paymentMethodViewController STPPaymentContext STPPaymentContext selectPaymentMethod 1 Answer 1 STPPaymentContext i...

Unable to reload only the selected cell

Unable to reload only the selected cell I want to reload only the selected cell in particular when tapping a picture in a cell.But i got the error cannot convert value of type 'IndexPath.Type' to expected argument type 'IndexPath'in this line: loadPostsValue(indexPath: IndexPath) func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let indexPath = self.collectionView.indexPathsForSelectedItems print(indexPath) loadPostsValue(indexPath: IndexPath) } func loadPostsValue(indexPath: IndexPath) { posts.removeAll() let ref = Database.database().reference() ref.child("posts").observe(.childAdded) { (snapshot: DataSnapshot) in if let dict = snapshot.value as? [String: Any] { guard let titleText = dict["title"] as? String else{return} let locationDetails = dict["location"] as! String let capt...

Error with lastest version Xamarin.Forms Button.CornerRadius

Error with lastest version Xamarin.Forms Button.CornerRadius [Update: Code worked on Android 8.0 simulator] I keep receive error No CornerRadius property found for the type Button My code behind public TabbedPage1 () { InitializeComponent(); this.FindByName<Button>("runButton").CornerRadius = screenX / 5; } My xaml <?xml version="1.0" encoding="utf-8" ?> <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="FuckThis.TabbedPage1"> <ContentPage x:Name="Page1"> <RelativeLayout> <Button xmlns:android="http://schemas.android.com/apk/res/android" x:Name="runButton" Text="Run" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Propert...

How to add multiple segues from one viewController

How to add multiple segues from one viewController I have a UI view controller(viewControllerOne) with a table view in it. I have a segue from a button in the cell to another viewController (viewControllerTwo). This works fine. now , i have a third view controller and want to have a segue from another button in View Controller one . How to have multiple segues from one view controller to go to different viewController. 2 Answers 2 First segue should be between the VC itself ( not a button inside the cell ) to the destinationVC as to be able to send data in prepareforSegue , so from the yellow icon of VC1 drag to both VC2 and VC3 and give a segue identifier like toSecond & toThird respectively then in code do prepareforSegue // change segue identifier if you want to third self.performSegue(withIdentifier: "toSecond ", sender:nil) After that I used if el...

Want to call method after firebase authentication is complete

Want to call method after firebase authentication is complete func signUpPressed(){ guard let email = signupview.emailTextField.textField.text, let password = signupview.passwordTextField1.textField.text, let name = signupview.nameTextField.textField.text else{ return } Auth.auth().createUser(withEmail: email, password: password, completion: {(User, error) in if error != nil{ print(error) return } let ref = Database.database().reference() let uid = User?.user.uid! let userReference = ref.child("Users").child((uid)!) let values = ["name": name, "email": email] userReference.updateChildValues(values, withCompletionBlock: {(err, ref) in if err != nil{ print(err) return } print("User saved to firebase") }) }) getUserInfo() } What I hope to achieve from this is t...

How does Pythonista Work within App Store Restrictions?

How does Pythonista Work within App Store Restrictions? I recently found out about an iOS IDE known as Pythonista, which claims to be a full Python 3.6 IDE and interpreter for the iOS platform, including several important libraries and bindings for native iOS APIs. My question is: how does it work? My understanding of the iOS security model is that all code must be signed and all (non-Apple) apps that dynamically generate or execute code are automatically banned from the App Store. This is the rule that prevents people from writing compilers, interpreters, shell terminals, emulators, virtual machines, etc. for iOS and offering them on the App Store. How does Pythonista get away with having a Python interpreter without running afoul of Apple? Is it running the code remotely on a server? 1 Answer 1 This article is about a year old now, but still relevant. Pythonista and Codea (for Lua dev on the iPad)...

UIButtons and UITextViews not working in Scrollview

Image
UIButtons and UITextViews not working in Scrollview So I have a scrollview with a view inside. In this view I have several textviews and buttons. When I run the app, it will scroll, but I cannot click the buttons or insert text into the textviews. I have checked for multiple solutions online and have yet to find one. I have already allowed user interaction on everything. I have disabled the click delay. I am running out of ideas here. share code or better a demo of what you have tried – Sh_Khan Jun 30 at 23:06 Have you tried using the Debug View Hierarchy to check if there is something else blocking the textview and buttons? – mn1 Jun 30 at 23:28 please share your cod...

Why UIImageView when its content mode is .scaleAspectFill in portrait pictures goes over its constraints?

Image
Why UIImageView when its content mode is .scaleAspectFill in portrait pictures goes over its constraints? I'm creating an image gallery using ImageView and CollectionView. Everything is working fine but portrait mode pictures go over constraints. Why is that? myPicture = UIImageView(image: myArray[0]) view.addSubview(myPicture) myPicture.translatesAutoresizingMaskIntoConstraints = false myPicture.contentMode = .scaleAspectFill myPicture.topAnchor.constraint(equalTo: tabBar.bottomAnchor, constant: view.bounds.height / 80).isActive = true myPicture.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0).isActive = true myPicture.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0).isActive = true myPicture.bottomAnchor.constraint(equalTo: collectionView.topAnchor, constant: 0).isActive = true 1 Answer 1 You need to set myPicture.clipsToBounds = true ...

non-deterministic crashing behavior in app w/ custom frameworks

non-deterministic crashing behavior in app w/ custom frameworks I am working on an app that uses 4 frameworks i made. Its structured as a workspace and each framework has a project. This one framework that basically encapsulates some UIKit convenience functions keeps on crashing at this call site. containerView.pinTo(superView: hostView) . containerView.pinTo(superView: hostView) what happens is I build and run the app once. Then, for the second and remaining runs it crashes here. So its non-deterministic in that it works once, but never again. Here, both hostView and containerView are not nil. hostView containerView When problems occur at this level (frameworks, linking, etc.) I don't even know where to begin. I've embedded and linked the frameworks as best as I know. What is happening here? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, priv...

Android Wrap content equivalent in story board in iOS?

Android Wrap content equivalent in story board in iOS? I am trying to build a UI in iOS Now, the way I set up constraint is that Button and Images have constant width and height, and my UITextView, have equal width and leading edge set. And now story board is complaining that my uiTextVIew doens't have a height. My question is, since the content inside my uitextview is dynamic, and depending on the screen width, i believe it may fit more text per line or less. Is there a height="wrap_content" equivalent in iOS storyboard that I could set to that text view?? Or is this something actually that I have to do in the code??? Thanks 1 Answer 1 Nope , there is no content-wrap equivalent in IOS , you have to give that textView an inital height in IB , then hook that height as IBOutlet and whenever you set a text to it do IBOutlet textViewHeight.constant = textView.contentSize.height ...

iOS App Preview without iPhone 6 Plus

Image
iOS App Preview without iPhone 6 Plus I have done an iOS App Preview (Video) using iPhone 6 and Quicktime in Yosemite, but I cannot upload it for iPhone 6+ in iTunes Connect, and I don't have an iPhone 6+ Device. Is there a way to make an App Preview (Video) for iPhone 6+ without the device ? Perhaps you can use some third party, (Mac) screen capture software to capture a movie of the iPhone 6+ simulator. There are a few, most are not free, and I don't know their performance (frames dropped, capture audio or not, etc.) – Nicolas Miari Dec 3 '14 at 7:11 capturing the simulator will also capture the mouse movement, which is bad. – Mohammed Dec 5 '14 at 14:56 ...

UIImageView disappears when aspect ratio constraint applied

Image
UIImageView disappears when aspect ratio constraint applied Xcode 9.3, MacBook Pro running OS 10.13.4 When I add an aspect ratio constraint to a UIView in IB, the view doesn't render in the simulator. Trying to find out where it went, I logged the relevant frame coordinates with the constraint absent, and then present. The coordinates appear identical, but see screenshots for difference. UIView With no constraints: self.view.center = (207.0, 368.0) self.thumbView.center = (93.0, 207.5) self.viewFinder.center = (187.5, 163.5) self.view.frame = (0.0, 0.0, 414.0, 736.0) self.thumbView.frame = (30.0, 174.0, 126.0, 67.0) self.viewFinder.frame = (16.0, 75.0, 343.0, 177.0) With only aspect ratio constraints: self.view.center = (207.0, 368.0) self.thumbView.center = (93.0, 207.5) self.viewFinder.center = (187.5, 163.5) self.view.frame = (0.0, 0.0, 414.0, 736.0) self.thumbView.frame = (30.0, 174.0, 126.0, 67.0) self.viewFinder.frame = (16.0, 75.0, 343.0, 177.0) Sure would appreciate some h...

spaces on mail body when we Open gmail app from iOS url schemes

spaces on mail body when we Open gmail app from iOS url schemes Is it possible to provide spaces or new line or line breaks on gmail compose on URL schemes. I tried both /n or stringByAddingPercentEscapesUsingEncoding , but space or lines breaks are not reflecting. /n stringByAddingPercentEscapesUsingEncoding googlegmail:///co?subject=subject&body= "nnn textfirstname" googlegmail:///co?subject=subject&body= "nnn textfirstname" Use HTML email body and a <a href="googlegmail:....">Whateverntextnyounwant</a> . – rmaddy Jun 30 at 19:33 <a href="googlegmail:....">Whateverntextnyounwant</a> 1 Answer 1 This is not an issue with iOS or url-scheme. You need to use html tag to set new line. F...

VertScrollBox Detect when bottom reached android and IOS

VertScrollBox Detect when bottom reached android and IOS I have GridLayout1 on a VertScrollBox1 . The vertical scroll box scrolls through the content of the grid layout. I need to detect when the Vertical scroll box reach the bottom so I get to load more content to the grid layout. And do it again whenever bottom is reached again. GridLayout1 VertScrollBox1 How can I achieve this? 1 Answer 1 Use the OnViewportPositionChange() of the VertScrollBox1 . Then some simple arithmetics tell you when you are at the bottom: OnViewportPositionChange() VertScrollBox1 uses Math, ...; // ... procedure TForm1.VertScrollBox1ViewportPositionChange(Sender: TObject; const OldViewportPosition, NewViewportPosition: TPointF; const ContentSizeChanged: Boolean); begin if CompareValue(NewViewportPosition.Y, GridLayout1.Height - VertScrollBox1.Height) = EqualsValue then Memo1.Lines.Add('At bottom, time to gro...

Get the uiSegmentControl value for edit

Get the uiSegmentControl value for edit i have a segment control to define the difficulty level for the preparation a recipe. I need to load the value assign at one recipe that I won't to edit it. The follow the code: @IBOutlet var segNewDifficultyLevel: UISegmentedControl! @IBOutlet var ingredientTableView: UITableView! @IBOutlet var directionTableView: UITableView! weak var delegate: AddNewRecipeViewControllerDelegate? // MARK: - Variabili Globali var editRecipe: RecipeModel! var difficultyLevel: String! var ingredients: [IngredientModel] = var directions: [DirectionModel] = This code is in the viewDidLoad: if let editToRecipe = editRecipe { title = "Edit Recipe" // Load data from Recipe Detail into editRecipe viewImageNewRecipe.image = editToRecipe.imageRecipe fieldNewRecipeName.text = editToRecipe.nameRecipe fieldNewQuantityFor.text = editToRecipe.quantityRecipe fieldNewPrepareTime.text = editToRe...

Storing app data under one entity Core Data

Storing app data under one entity Core Data I am making an app where a string is shown, and then they have to pick the correct string from 4 options. I need to update a score, based on whether they get it right or wrong. Let's call the string that is shown to them: shownString For ease and efficiency, I am planning to have ONE core data entity and only store one object for that entity, which will be a transformable type, that is an array with nested arrays/tuples, that contains shownString and the score for every shown string that could come up in multiple choice. The reason I am doing it like this as opposed to storing individual objects for each word and score is because it will make it easier to update the object i.e. delete and add it back in again. I am fairly new to Core Data, so please could you tell me if there are any problems with this, or if you think it is a good/acceptable way that will work well then please also tell me. Thanks What's t...

React Native Debugger state undefined

React Native Debugger state undefined I am trying to use the remote React Native Debugger for my project. I have installed React-Native-Debugger on my Mac with $ brew update && brew cask install react-native-debugger . Then I added Remote-redux-devtools package with npm install --save-dev remote-redux-devtools $ brew update && brew cask install react-native-debugger npm install --save-dev remote-redux-devtools My createStore code looks like this atm. import { createStore, applyMiddleware } from 'redux' import { composeWithDevTools } from 'remote-redux-devtools' import thunk from 'redux-thunk' /* some other imports */ const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 }) export default createStore(rootReducer, composeEnhancers( applyMiddleware(thunk.withExtraArgument(api), logger, firebaseSave) )) Console output works just fine, but it is not picking up on the actions or redux state. Am I missing a step? Why isn't it ...

Will I be able to code/publish iOS and Android apps in Mountain Lion using React Native framework?

Will I be able to code/publish iOS and Android apps in Mountain Lion using React Native framework? I'm starting to learn React Native and I'd like to NOT use Create React Native App to code for Android and iPhone because it seems I'll lose some part of the "fun". Create React Native App In order to do that, it seems I need to use a Mac OS to code, or at least test on iPhone. MacBooks are out of my budget at the moment, and download from internet is not an option, so the only option, that seems quite right, is to virtualize a Mac OS, but the latest available OS to buy is Mountain Lion . Mountain Lion Will I be able to code/publish iOS and Android React Native apps on Ubuntu and test/publish, on both plataforms, using Mountain Lion in a VM? Thanks in advance! iOS Android Mountain Lion By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, priva...