본문 바로가기

에러 모음 및 해결3

Xcode에서 warning 표시 끄는법 Xcode에서 OpenGL 코드를 짜다가 코드에 Warning이 뜨는 것을 발견했다. 빌드는 정상적으로 되었지만 보기가 너무 안좋다. 이 warning 표시를 끄는 방법은 1. 프로젝트 -> Build setting에 들어간다. 2. 오른쪽 위 Fillter에 'Warning'을 입력한다. 3. 조금 내리면 나오는 'Apple Clang - Warning Policies'에서 'Inhibit All Warnings'를 No -> Yes로 바꿔준다. 그리고 잠시 기다리면 warning 표시가 사라지는것을 볼 수 있다. 2022. 10. 14.
[ERROR | Java] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at 오류 public class Geometry { public static void main(String[] args) { System.out.println(args[0]); } } 에러코드 위 코드를 컴파일하였을 때 오류가 발생하였다. ' Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at ' 에러문 해결방법 위 오류는 배열을 잘못 참조했을때 나오는 오류이다. 때문에 자바 파일을 실행할 때 args에 인자를 넘겨주고 사용하면 에러가 해결된다. java 파일이름.java 인자값 {인자값2} {인자값3} ... 위와 같이 파일 이름 뒤에 인자값을 넘겨주면 args배열에 순서대.. 2022. 9. 8.
[ERROR | Python] AttributeError: 'builtin_function_or_method' object has no attribute 오류 from random import random def fresh_deck(): suits = {"Spade", "Heart", "Diamond", "Club"} ranks = {"A", 2, 3, 4, 5, 6, 7, 8, 9, 10, "J", "Q", "K"} deck = [] for s in suits: for r in ranks: card = (s, r) deck.append(card) random.shuffle(deck)// 2022. 6. 4.